is there a way to restrict tab on a field that is empty?

gino

Registered User.
Local time
Today, 12:47
Joined
Mar 16, 2000
Messages
117
yes, i've tried validation rule but it only works if you attempt to fill the field incorrectly. unfortunately, some users will by pass the field and hit the command button to open another form. what i am trying to do is to restrict user to click the command button if the field is empty.

first, i have one form with a field and one command button. the command button opens a second form based on that one field.

i there a way to have a validation rule on a command? if anyone can help me out i would really appreciate it. thank y
 
Set the [CommandButton] Enabled property to No. Make sure the Tab Order for the form is set so that the cursor is in [Field] when the form opens. Then put this code in the OnExit property for [Field]: Iif(Not IsNull(Me![Field]), Me![CommandButton].Enabled = True, MsgBox "You must fill in this field to continue.", vbOKOnly).

Be sure to change the names of the button and field to the actual names. Also, you should include a Cancel button on the form to give users a way out if they want it.
 

Users who are viewing this thread

Back
Top Bottom