View Full Version : Create Mandatory field


klee
11-27-2001, 05:38 PM
I wonder is there any one can show me how to control the data in the form. I want all the field to be filled before user can submit the form.

Thanks

jwindon
11-28-2001, 03:46 AM
Enforcing data integrity can be done at the table level by setting fields to "Required: Yes".

Else, you can code your form.

klee
11-28-2001, 11:02 AM
Thanks jwindon,
I did that, but the problem is if I changed the Required field to Yes, it will create a problem for the form. I have form that linked two tables together, but does not required all the attributes to be part of the form, if I changed that, it won't allow me to save my data, a box will say "You can't have the "XYZ attribute" to be nulled.

Any comments?
Thanks

jwindon
11-28-2001, 01:44 PM
Like I said.....

Else, you can code your form.

If IsNull(Me.ControlName) Then
Msgbox "This information is required"
Me.ControlName.SetFocus
Exit Sub
Else
End If


Can get fancier than that, but that will get your research started. Good luck.