Trapping bad data in a text box

  • Thread starter Thread starter David Wetmore
  • Start date Start date
D

David Wetmore

I have a text box which is either empty or contains a value.
There are two errors, an empty box or a bad value. I can easily check for either one.

Given bad data, I want to loop, each time giving the user the opportunity to
enter a new value. The looping is not my problem, my problem is letting the user enter a new
value into the text box while in the loop. How do I do this?
 
I have a text box which is either empty or contains a value.
There are two errors, an empty box or a bad value. I can easily check for either one.

Given bad data, I want to loop, each time giving the user the opportunity to
enter a new value. The looping is not my problem, my problem is letting the user enter a new
value into the text box while in the loop. How do I do this?

A bit of an example of bad data would have been appropriate here.

Perhaps....
Code the Control's BeforeUpdate event:

If IsNull(Me.[ControlName]) or Me.[ControlName] <> Some Criteria Then
MsgBox "Incorrect entry"
Cancel = true
End If
 
Back
Top