query with question, where you choose from values based on table

  • Thread starter This is display name :)
  • Start date
T

This is display name :)

I want to make query, where it ask for value (name) and then uses this value
in query itself. Names are stored in separated table. Thank you.
 
A

Arvin Meyer [MVP]

Enclosed the question in square brackets in the criteria box of the column
you want. Like:

SELECT *
FROM Table1
INNER JOIN Table2 ON Table1.FirstName = Table2.FirstName
WHERE (((Table2.FirstName)=[Enter a name to find]));
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

"This is display name :)" <This is display name
:)@discussions.microsoft.com> wrote in message
news:[email protected]...
 
C

Chanis

Hmm I am probably too unexperienced to understand this, but somehow i feel it
is not exactly what I want. I will try to explain it in details once more.

Table1
- name
- surname
- ID name

Table 2
- ID order
- date of order

Table 3
- list of food
-date of menu

Each day, you are offered by 3 different type of food, and you can choose
one to order it. So you can get a list showing:

Name, surname, day, ordered food

Now, I want to see what ordered person A each day, but I want to select name
of person after I call query - so i dont want write his name into pop-up
window (i want to choose him from list of names).









Arvin Meyer said:
Enclosed the question in square brackets in the criteria box of the column
you want. Like:

SELECT *
FROM Table1
INNER JOIN Table2 ON Table1.FirstName = Table2.FirstName
WHERE (((Table2.FirstName)=[Enter a name to find]));
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

"This is display name :)" <This is display name
:)@discussions.microsoft.com> wrote in message
I want to make query, where it ask for value (name) and then uses this value
in query itself. Names are stored in separated table. Thank you.
 
A

Arvin Meyer [MVP]

To do that properly, you would always use a form bound to the query, not the
query itself. If that's the case have your query refer to the combobox on
the form. The criteria box would then look like:

[Forms]![YourFormName]![YourComboName]
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

Chanis said:
Hmm I am probably too unexperienced to understand this, but somehow i feel it
is not exactly what I want. I will try to explain it in details once more.

Table1
- name
- surname
- ID name

Table 2
- ID order
- date of order

Table 3
- list of food
-date of menu

Each day, you are offered by 3 different type of food, and you can choose
one to order it. So you can get a list showing:

Name, surname, day, ordered food

Now, I want to see what ordered person A each day, but I want to select name
of person after I call query - so i dont want write his name into pop-up
window (i want to choose him from list of names).









Arvin Meyer said:
Enclosed the question in square brackets in the criteria box of the column
you want. Like:

SELECT *
FROM Table1
INNER JOIN Table2 ON Table1.FirstName = Table2.FirstName
WHERE (((Table2.FirstName)=[Enter a name to find]));
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

"This is display name :)" <This is display name
:)@discussions.microsoft.com> wrote in message
I want to make query, where it ask for value (name) and then uses this value
in query itself. Names are stored in separated table. Thank you.
 
Top