
Textbox AfterUpdate problem
Hei !
I have a userform with some textboxes. The user enters data into the first
textbox hits TAB and move to the next textbox.
When the user clicks an OK button some calculations are made using the
values in the textboxes.
To evaluate the input in the textboxes I use TextBox_AfterUpdate, but it
doesn't behave as I want it to. I thought that TextBox1.SetFocus would
select Textbox1, but it doesn't. Any ideas anyone ?
Private Sub TextBox1_AfterUpdate()
On Error Resume Next
Select Case TextBox1.Value
Case Is < 440
MsgBox "Vannstand for lav, LRV=440,00. Pr?v igjen !",
vbExclamation, "Tabbe !"
UserForm1.TextBox1 = ""
TextBox1.SetFocus '****Why doesn't this work ?
Exit Sub
Case Is > 454
MsgBox "Vannstand for H?y, HRV=454,00. Pr?v igjen !",
vbExclamation, "Tabbe !"
UserForm1.TextBox1 = ""
TextBox1.SetFocus
Exit Sub
End Select
End Sub
Knut Egil