A
AL
how can I triger an event when the user navigates from one
record to another (next or previous)
thanks
Al
record to another (next or previous)
thanks
Al
how can I triger an event when the user navigates from one
record to another (next or previous)
That is not what I am after! here is the full scoop. I
have a field on a form and want to make sure that the user
does not move to next or previous records and leave that
field blank. So I want to catch the user when he tries to
navigate to another record with that field blank, to stop
that action.
-----Original Message-----
Well, you'ld also want to check if they use the menu to save the
record, or close the form or the database (which will also
automatically save the record, right?)
Use the Form's BeforeUpdate event:
Private Sub Form_BeforeUpdate(Cancel as Integer)
Dim iAns As Integer
If Me!txtX & "" = "" Then ' Was txtX left blank?
iAns = MsgBox("txtX Must be filled in. Click OK to do so, " _
& "Cancel to erase the form and start over:", vbOKCancel)
Cancel = True
If iAns = vbOK Then
Me!txtX.SetFocus
Else
Me.Undo ' erase the form
End If
End If
End Sub
John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps? loc=us&access=public
.