Find a Record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that collects information in date and time order. Then later,
the client needs to come back and enter additional information to the
records. I need an easy way for the client to "find" or "search" for the
date and time, rather than have to scroll through all of the records. I do
not want them to have to use the system find, rather would like a dialog box
or input box of some kind where they could enter the date and time they need
to get to.
 
Design said:
I have a form that collects information in date and time order. Then later,
the client needs to come back and enter additional information to the
records. I need an easy way for the client to "find" or "search" for the
date and time, rather than have to scroll through all of the records. I do
not want them to have to use the system find, rather would like a dialog box
or input box of some kind where they could enter the date and time they need
to get to.


Instead of an input box, I suggest that you open the form
for their edits first. You can use an unbound text box in
the header on the form where they can enter the desired
date.

Assuming the records in the form are sorted in ascending
order, a small amount of code in the text box's AfterUpdate
event procedure can then move to the first record that
matches that date:

If Not IsNull(Me.thetextbox) Then
With Me.RecordsetClone
.FindFirst "thedatefield >= " _
& Format(Me.thetextbox, "\#m\/d\/yyyy\#")
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
End If
 
Thank you Marsh - that was exactly what I wanted. I also added on the forms
on current event a code (SearchBox = Date) so that the search box shows the
same date as the date field if the user advances using the navigation
controls. Perfect for my needs!
 
Back
Top