Search Form? (1 Viewer)

drscot19

Registered User.
Local time
Today, 03:13
Joined
Jan 14, 2001
Messages
24
Help! I am trying to create a search form that queries a table with many fields and reproduces the results in a popup box where the user can select one of the records and that record will be displayed.

The search form has one textbox control for input, how can I query all the fields in a table and have any matching words in any of the fields be recognized?

Thanks for your help!
 

drscot19

Registered User.
Local time
Today, 03:13
Joined
Jan 14, 2001
Messages
24
Thanks for the suggestion but I already looked at the sample database and not one of the samples show how to search more than one field. The samples are all basic samples.

Maybe I can explain it a little better. I have a main data input form where a customers name, social security number, address, and other information is entered. The user clicks on a "Search" button and is presented with a form the has one textbox control and one button. The user may input into the textbox anything from a persons name,street address, zipcode, etc... and clicks on the button to query a table and place the results into another form that the user can view and select the customer they want. the table is setup like this:

Table: tblcustomer
Fields:
namefirst
namemiddle
namelast
addstreet
addcity
addstate
addzip
phone1 (Phone 1)
phone2 (Phone 2)
ssnumber (Social Security Number)
What I can't figure out is how to search more than one field at a time instead of searching say the namelast only. I would like to know how I can search the namefirst, namelast, namemiddle, etc... without having to have multiple textboxes on the search form.

Thanks for your help!
 

Fornatian

Dim Person
Local time
Today, 03:13
Joined
Sep 1, 2000
Messages
1,396
Do this by putting the criteria on different lines in the query grid, this effectively says show all records where CriteriaRow1 or CriteriaRow2 or CriteriaRow3 matches.

You can enter the same textbox reference on different lines.

Alternatively you have a concantanated field like:

FullName: namefirst & " " & namemiddle & " "& namelast

You can then search on this alone using

LIKE "*" & Forms!YourForm!YourControl & "*"

and this will return all instances where it occurs in either forename,surname or middlename.

Ian
 

Users who are viewing this thread

Top Bottom