G
Guest
I have findrecord working. However, if it doesn't find a record with the
search criteria's value it doesn't display a message. It adds a record on a
new form or changes info on an existing info. I doen't want it to do
anything if it doesn't find the correct record, how do I do that? This is
what I have:
----------start code------------
Me.PackageID.SetFocus
DoCmd.FindRecord Me.GoToTrackingNo, acStart
If IsNull(Me.PickUpDate) Then
Me.PickUpDate = Now()
MsgBox "Package ID No: " & Me.PackageID & " -- Tracking #: " &
Me.TrackingNo, , "Package pick-up information was saved successfully."
Me.GoToTrackingNo.SetFocus
Else
MsgBox "This package has already been picked up!"
Me.GoToTrackingNo.SetFocus
End If
-------end code----------
search criteria's value it doesn't display a message. It adds a record on a
new form or changes info on an existing info. I doen't want it to do
anything if it doesn't find the correct record, how do I do that? This is
what I have:
----------start code------------
Me.PackageID.SetFocus
DoCmd.FindRecord Me.GoToTrackingNo, acStart
If IsNull(Me.PickUpDate) Then
Me.PickUpDate = Now()
MsgBox "Package ID No: " & Me.PackageID & " -- Tracking #: " &
Me.TrackingNo, , "Package pick-up information was saved successfully."
Me.GoToTrackingNo.SetFocus
Else
MsgBox "This package has already been picked up!"
Me.GoToTrackingNo.SetFocus
End If
-------end code----------