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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

searching a form

Status
Not open for further replies.

billmsacces

Programmer
Feb 2, 2004
16
0
0
US
I am currently using the built in FIND feature in Access to find records in my database. The FIND feature works but it is clunky. Is there a code that would search specific fields in the database. I’m thinking of something like Query By Form, but instead of displaying the info in a datasheet, it would display it in my form.
Thanks.
B.
 
do you want to use the find methods of the recordset to find stuff? that can be set up with relative ease.
 
if you describe how the form that you want to search in is set up, etc. I'll be able to give you a solution using code fairly easily. Basically you'd have a textbox in which you'd enter the criteria you wanted to search for, then use the recordset object of the form to search the underlying table for the information that was pertinent to you. Let me know how your info is set up and what you are going to be searching for and I'll elaborate further.

Thanks,
Jimb0ne
 
The Form I'm using is based on a query called qryCite. (The query is based on tblName and tblPub). The form contains several fields, but the ones I'm interested in searching are txtPubDate, which is the publication date, and txtSurname, which is the last name of the individual. There is also txtFirstName, but it isn't crucial that that one is searchable.
 
you just want the form to jump to the record which has the appropriate surname/publication date when you click a button to search? or do you want to have a seperate search form which will allow the user to select from a number of different results after the search is complete.
 
I would like to have a result list if possible.
Thanks.
B
 
hmm, well there is no real easy way to go about this. The way I've done it in the past is by having several labels which were then populated with results. Clicking on the labels would bring you to the coinciding record, and you could scroll through pages of results by using command buttons. Unfortunately this solution isn't really extremely simple, and is difficult to explain. If you would like I could post some of the code I used and try to explain it, although it would be a relatively large post.
 
That would be great if it wasn't too much trouble.
Thanks.
B
 
And what about the Filter property and the DoCmd.ApplyFilter method ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top