Here is the code another member gave me.


Private Sub TextBox1_Change()
If Val(TextBox1.Text) < 1 Or Val(TextBox1.Text) > 5 Then
MsgBox "Please enter a number between 1 and 5".
TextBox1.SetFocus
End If
End Sub

That works fine, it limits users from entering values less than one and greater than 5 but if the user simply presses enter or tab the box remains blank.

I have tried several ways to capture this event. Is this a problem with the AutoTab feature?

Thanks.