PDA

View Full Version : Solved: Userform query



blackie42
10-01-2008, 07:55 AM
Hi

Just wondering if its possible while entering figures in to a number of userform textboxes to have a 'special' textbox that adds up the amounts in each textbox - while you are typing and before committing to the sheet.

e.g. Enter 50 in TB1 & 40 in TB2 and TB3(special) shows 90 (would need to be a locked textbox too)

any ideas welcome

thanks

Jon

Bob Phillips
10-01-2008, 08:51 AM
Private Sub TB1_AfterUpdate()

TB3.Text = Cstr(Val(TB1.Text + TB2.Text)
End Sub


Private Sub TB2_AfterUpdate()

TB3.Text = Cstr(Val(TB1.Text + TB2.Text)
End Sub

blackie42
10-01-2008, 02:42 PM
Hi -thanks for reply but doesn't seem to work -compile error:syntax error

Have copied in to userform code window & changed textox names to TB1 etc

any ideas

Jon

Bob Phillips
10-01-2008, 02:54 PM
My mistake



Private Sub TB1_AfterUpdate()

TB3.Text = CStr(Val(TB1.Text) + Val(TB2.Text))
End Sub

Private Sub TB2_AfterUpdate()

TB3.Text = CStr(Val(TB1.Text) + Val(TB2.Text))
End Sub

blackie42
10-02-2008, 06:50 AM
Thanks for your help Bob - works fine

regards

Jon