Thread: Search feature?
View Single Post
  #3  
Old April 28th, 2008, 09:49 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Search feature?

You could use text boxes, or were I doing it, I would use text boxes that
would return a list of the available values in each field.
Then in the click event of the search button, build an SQL string with a
WHERE clause based on the value in each text box.

Then open a recorset based on the query and see how many rows are returned.
If none are return present a message box stating no matching employee found.
If one record is returned, open your form using the employee table's primary
key field as the value for the Where argument of the OpenForm method. If
multiple records are returned, open the middle man form using the same
technique, except you would build the Where argument using the keys from all
returned records using ORs.
--
Dave Hargis, Microsoft Access MVP


"twalsh" wrote:

I have form with several subforms showing a great many aspects of employee
data. This information is present for over 5000 employees.

I want to add Single Simple form to start with and have it as a "Search
Screen"
So you will have several empty text boxes associated with a field and you
enter what criteria you know and click a command button that brings you to
the form with that employees data. I found the QBF_Macro support page but it
brings the info up as a datasheet instead of the form.

Also if possible i would like to have a "Middle Man Form" that shows up only
if the entered criteria brings more than one result and you can pick which
result you want...