Storing the user input of a parameter query.

  • Thread starter Thread starter skhan20
  • Start date Start date
S

skhan20

Guest
Hi,

How do you store the user input in a variable so that it can be used later on within the same parameter query ?

eg. In the following QUERY:-

SELECT name
FROM DOCLIST
WHERE bookName LIKE "*" & [Search word: ] & "*";

I would like to store the user input in a variable, so that I can use it later on within the same select clause.

I mean I want to do this:-

SELECT name
FROM DOCLIST
WHERE bookName LIKE "*" & [Search word: ] & "*"
UNION
SELECT author
FROM AUTHORLIST
WHERE title LIKE "*" & [Search word: ] & "*";


DOCLIST & AUTHORLIST are seperate tables with different set of fields & different data on it.


I don't want to prompt the user twice. I would like to store the first input in a variable so that I can use it later on.

Thanx in advance.

----------------------------SAKIB
 
Why not have user select criteria from a cbo on a form or type in criteria in an unbound textbox on a form then refer to the control in the criteria for the desired search fields in the query.
[Forms]![YourFormName]![YourControlName]
 
This should not cause two prompts. If it is, it is because the spelling of the two instances is not exact. cut and paste to fix the problem.
 

Users who are viewing this thread

Back
Top Bottom