Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 08-08-2002, 08:59 AM   #1
skhan20
Guest
 
Posts: n/a
Storing the user input of a parameter query.

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

  Reply With Quote
Old 08-08-2002, 09:07 AM   #2
Jerry Stoner
Guest
 
Posts: n/a
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]
  Reply With Quote
Old 08-08-2002, 04:11 PM   #3
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 28,163
Thanks: 15
Thanked 1,575 Times in 1,497 Posts
Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all
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.

Pat Hartman is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump




All times are GMT -8. The time now is 05:51 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World