Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validation Rule in Access

Status
Not open for further replies.

sogibear

Programmer
Jul 4, 2002
45
GB
Hello,

I'm trying to write a validation rule that will stop a user from continuing to fill in a from if they have not

filled in the "Firstname" field. I am using this as a validation rule on that field but it is not working :

i have tried, Not "isNull"
i have also tried, <> &quot; &quot;
i have also tried, Not is Null

Please help
Thanks
:)
 
How about:

Private Sub txtFirstName_Exit(Cancel As Integer)

If IsNull(me.txtFirstName) then
msgbox &quot;This is a required field&quot;
else
end if

End Sub

where txtFirstName is the name of the control you dont want to be empty
 
Thanks, i can do it in code but i need to do it in the validation rule properties box on an Access Form.

:)
 
In the validation field try...

len([x])>= y

Where x is the name of the field and y is the minimum number of characters the user must enter.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top