Validation Rule Help please

S

Steve Goodrich

I want to set the validation rule to "is not null" on several fields on my
form using the forms property sheet.

For some reason it doesn't work at all - Is there any other setting I need
to change? The validation rule works fine if I set it in the table bound to
the form.

What I'm trying to do is base three forms on the same table with different
rules for each, so setting the rule on the table is no good

Any help would be appreciated

Steve
 
J

John Vinson

I want to set the validation rule to "is not null" on several fields on my
form using the forms property sheet.

For some reason it doesn't work at all - Is there any other setting I need
to change? The validation rule works fine if I set it in the table bound to
the form.

What I'm trying to do is base three forms on the same table with different
rules for each, so setting the rule on the table is no good

Any help would be appreciated

Steve

I'd use the Form's BeforeUpdate event instead: you can control the
error message and the level of validation more precisely. Frex,

Private Sub Form_BeforeUpdate(Cancel as Integer)
If Me!txtThis & "" = "" Then
MsgBox "Please fill in This", vbOKOnly
Cancel = True ' cancel the record update
Me!txtThis.SetFocus
End If
End Sub

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top