Results 1 to 2 of 2
2004-10-08, 10:30 #1
- Join Date
- Jan 2004
- Norfolk, England
- Thanked 0 Times in 0 Posts
User to fill in all fields. (2000)
I was then about to write an amount of code that would prevent the user from exiting a form and not entering certain data in all the available fields.
My approach was going to be:
If IsNull(Me.Date) Then
MsgBox "Please enter a valid date", vbInformationOnly,"Error!"
And so on for each field on the exit control of the form. What I'd like to know, is there a quick way to code this to include all fields available on the form as opposed to referring to the name of each field? Presumably with a generic message of "There is data missing, please amend!", I guess that the SetFocus command will not be used.
2004-10-08, 10:38 #2
- Join Date
- Mar 2002
- Thanked 30 Times in 30 Posts
Re: User to fill in all fields. (2000)
You can do this at the table level, if you wish. Open the table that contains the data in design view.
One possibility is to set the Validation Rule property for each field to Is Not Null, and the Validation Text to a suitable warning.
Another possibility is to set the Required property to Yes; if the field is a text field, also set the Allow Zero Length property to No.