Message Boxes (1 Viewer)

RadioProject

New member
Local time
Today, 13:49
Joined
Dec 16, 1999
Messages
5
I am trying to write a debug script in a module so that a Null value is left in a text box. How do I go about executing a Message Box telling the user to enter something in before the rest of the code is executed?
 

Travis

Registered User.
Local time
Today, 05:49
Joined
Dec 17, 1999
Messages
1,332
Do your check on the BeforeUpdate of the Text Box Field. If the value is Null or empty :

if nz(Me.[TextField],"")="" then
msgbox "You must enter data"
Cancel = True
Exit sub
end if

Setting Cancel = True stops the leaving of the field, basically keeps them from Entering a null value. You can also run this from the Exit Event by Running it's BeforeUpdate Event.
 

Users who are viewing this thread

Top Bottom