Multiply The Contents Of Two TextBoxes With The Result To Appear In A Third TextBox

M

Minitman

Greetings,

I need to multiply the contents of TextBox1 with the contents of
TextBox2 and have the result show up in TextBox3. These three
TextBoxes are all on UserForm1.

I can't seem to get the syntax right. When I try to run any code It
kicks me into the debugger. Here is the code:

Private Sub TextBox1_Change()

SaveButton.Enabled = True
TextBox3.Value = (TextBox1.Value * TextBox2.Value) <<<<

End Sub

I also have it in TextBox2_Change()

The entry in TextBox1 is hours in decimal format and the entry in
TextBox2 is the rate in Dollars. All three TextBoxes have formatting
in an Exit event.

Any one see where I messed up?

TIA

-Minitman
 
B

Bob Phillips

Try

TextBox3.Text = Cstr(CDbl(TextBox1.Text) * Cdbl(TextBox2.Text))

The CStr is just to be sure.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top