Required Field on a Form

StacyStacy

A "Californian" at heart!
Local time
Today, 02:11
Joined
Jan 29, 2003
Messages
159
Can I make a field 'required' on the form level and not thru the table level?
 
Yes you can by placing some code in your form's BeforeUpdate event. For example

PHP:
If IsNull(myControlName) Then

MsgBox "Please enter something!", vbCritical, "Required Entry"
myControlName.Setfocus
Cancel = True

End If

This will test for a null, however if you have set at table level 'Allow zero length strings' to yes, then you'll need to also use the Nz function

HTH
Rob
 
Re: Requied Field on a Form

How would you set it up if you have say 5 txtboxes and 3cbo boxes that you want to make sure something is filled in?

I have tried the , and the word and and I can't get it to work.


***EDIT*** I figured it out... Just use a couple more IF statements. :)
 
Last edited:
Re: Requied Field on a Form

Or use the "tag" property.
 

Users who are viewing this thread

Back
Top Bottom