FindRecord help

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----------
 

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

Similar Threads


Top