An Easy find box in the form?

  • Thread starter Thread starter compteach
  • Start date Start date
C

compteach

Guest
How do I create a box in my form that allows me to enter a value and then access will find the record that matches that value (enter a 12 in a box that will find me customer # 12) - rather than using the find function...can it be done right on the form?
 
Make the textbox unbound, base the form on a query rather than a table and in the criteria of the field you want to filter the data on, enter =Forms!NameofForm!NameofTextbox.
On the after_update of the textbox, set it to me.requery.

This method will find that record only but will not allow you to browse the others. To do that, use the findrecord method (search in MS access help or use the search facility here)
HTH
 
What I did to do about the same thing (search for employers based on contact name or phone number) was to make combo boxes of available values in both fields and then in the code I put:
Private Sub cbxTelephone_AfterUpdate()
Me.RepostSubformE.Form.Filter = "[TelNum] = (cbxTelephone.Value) "
Me.RepostSubformE.Form.FilterOn = True
End Sub
where TelNum is the Telephone number field in the subform and cbxTelephone is the combo box with the telephone numbers.

Note: I also have a show all button, to get back to the original data.
 

Users who are viewing this thread

Back
Top Bottom