FIND Button

  • Thread starter Thread starter Paul Hamel via AccessMonster.com
  • Start date Start date
P

Paul Hamel via AccessMonster.com

I wanted to create a FIND button (binoculars) on my form so i can search
for a customer's last name and have it pull up that record.

Using Access 2000 (therefore cant use the wizard due to bugs in the program)
.. Is there any other way for me to insert that command?

Thanks,
Paul
 
Here's some example code that I have in a text box on one of my forms.
Basically the user just enters the text and pushes enter and it brings up the
record. There is no error checking in this code which would identify if no
records were found and display an error message.

Private Sub txtFind_AfterUpdate()
If Me.Dirty Then 'Save first
Me.Dirty = False
End If
Dim Record As String
Record = Me.txtFind

Me.Volume.SetFocus 'must set focus on the control that is going to be
searched
DoCmd.FindRecord Record, , , , , , True

End Sub
 
Back
Top