fo*******@martecgroup.com wrote in
news:11*********************@j33g2000cwa.googlegro ups.com:
the before event now looks like this:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Me!UpdatedOn = Now()
If PrimaryBusiness.Value = "Other" And PrimaryOther.Value Is
Null Then
MsgBox "Must enter type of business!!"
PrimaryOther.SetFocus
Cancel = True 'Important; this stops the record from being
saved.
End If
End Sub
When I try to run it I get a runtime error '424' Object
required. What does that mean? How do I get it to work?
Thanks.
Use this instead
Private Sub Form_BeforeUpdate(Cancel As Integer)
Me!UpdatedOn = Now()
If Me!PrimaryBusiness.Value = "Other" _
And isnull(Me!PrimaryOther.Value) Then
MsgBox "Must enter type of business!!"
Me!PrimaryOther.SetFocus
Cancel = True 'Important; this stops the record from being
saved.
End If
End Sub
the Me! qualifiers were missing and isnull() works when
sometimes is null does not.
--
Bob Quintal
PA is y I've altered my email address.