Required Field on a Form (1 Viewer)

StacyStacy

A "Californian" at heart!
Local time
Today, 01:16
Joined
Jan 29, 2003
Messages
159
Can I make a field 'required' on the form level and not thru the table level?
 

Robert Dunstan

Mr Data
Local time
Today, 07:16
Joined
Jun 22, 2000
Messages
291
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
 

rhett7660

Still Learning....
Local time
Yesterday, 23:16
Joined
Aug 25, 2005
Messages
371
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:

CEH

Curtis
Local time
Today, 01:16
Joined
Oct 22, 2004
Messages
1,187
Re: Requied Field on a Form

Or use the "tag" property.
 

Users who are viewing this thread

Top Bottom