Validation Rule Help please

  • Thread starter Thread starter Steve Goodrich
  • Start date Start date
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
 
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]
 
Back
Top