Parameter Query

kate10123

Registered User.
Local time
Today, 23:11
Joined
Jul 31, 2008
Messages
185
Hi there

I have a query made up of 5 fields from two tables. I would like this be a parameter query so that people can enter what they want to search by. I would ideally like two parameters on two fields, first name and last name. Is there a way of doing this without the user having to enter something in both?

I want to cover the fact that they might know the first name or last name but not both.

Any ideas appreciated!

:)
 
Simple Software Solutions

In the design of your query add an additional field as such

FullName:Trim(FirstName) & " " & Trim(LastName)

Where first & last are the names of your fields.

Then add a parameter to the query (right click in top pane and select parameters)

Enter Full or Partial Name - text type

Then on the condition line under this column enter:

Like "*" [Enter Full or Partial Name] & "*"

Your SQL should read something like this

PARAMETERS [Enter Full or Partial Name] Text ( 255 );
SELECT Trim([fldForename]) & " " & Trim([fldSurname]) AS Fname
FROM tblPeople
WHERE (((Trim([fldForename]) & " " & Trim([fldSurname])) Like "*" & [Enter Full or Partial Name] & "*"));

CodeMaster::cool:
 

Users who are viewing this thread

Back
Top Bottom