Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching for files within an access form

Status
Not open for further replies.

jdanner24

Technical User
Nov 13, 2003
4
US
Within a form, how can I pull up an existing record by using a cmdButton. I would like to create a button called search, where by placing information in a field on the form, it will pull the employee record associated with it. The search command within access is not an acceptable way to do this for this particular project.

Thanks
Jdanner24
 
Take a look at the RecordSetClone, FindFirst, NoMatch and Bookmark method/properties of the Form/RecordSet objects.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
The simplest way is to create one form with an unbound text box where the user types in their search target. Then create another form that selects just one record. You can use SQL, a query or the form to do the WHERE test. Then create the command button with a wizard and tell it you want to run the macro. Obviously you need to pass the value of the text box to the macro/query/SQL/form. Personnally I'd do that by using a query that refers to the text box control directly, like WHERE CandidateName = Forms!SrchFrm![Cand Srch Text Box]

 
...And a third solution is to use an unbound combo box (or boxes) to find the record. In fact, Access has wizard that will be invoked when you create the combo box specifically for this purpose.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top