Query parameters - select from table column?

D

Dorian

BY embedding something like:
WHERE T.Team = [Enter Team]
in my query I can promt for a team
However, is there any way to create a prompt that allows for selection of a
column from a table. I have a table of teams tblTeams and would like the
prompt to allow selection from a column in this table.
I'm wondering if I can do this without creating a form?
Thanks.
 
D

Duane Hookom

Take the time to create the form with a combo box. IMO, parameter prompts are
rarely good user interface.
 
M

MGFoster

Dorian said:
BY embedding something like:
WHERE T.Team = [Enter Team]
in my query I can promt for a team
However, is there any way to create a prompt that allows for selection of a
column from a table. I have a table of teams tblTeams and would like the
prompt to allow selection from a column in this table.
I'm wondering if I can do this without creating a form?
Thanks.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You'd have to create a form that has a ComboBox of the column from the
tblTeams table. Then, in the query, reference the form like this:

PARAMETERS Forms!FormName!ComboBoxName Text;
SELECT ...
FROM ...
WHERE T.Team = Forms!FormName!ComboBoxName

If the data that will be in the ComboBox is not Text be sure to change
the PARAMETERS clause data type to the correct type.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSdEQa4echKqOuFEgEQJAgACgzx96QiD1Lc7bcwiFglUMnIBA7a4AnRIb
LlAyXhgUBM+7U6zFJk4A6LH/
=UqGS
-----END PGP SIGNATURE-----
 
D

Dorian

Yes, I agree but this application just displays a list of queries, allows
selection of one and then opens the query. I could create a form but then I'd
have to change the whole design of how the queries are run.
Thanks.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".


Duane Hookom said:
Take the time to create the form with a combo box. IMO, parameter prompts are
rarely good user interface.
--
Duane Hookom
Microsoft Access MVP


Dorian said:
BY embedding something like:
WHERE T.Team = [Enter Team]
in my query I can promt for a team
However, is there any way to create a prompt that allows for selection of a
column from a table. I have a table of teams tblTeams and would like the
prompt to allow selection from a column in this table.
I'm wondering if I can do this without creating a form?
Thanks.
 
J

John W. Vinson

Yes, I agree but this application just displays a list of queries, allows
selection of one and then opens the query. I could create a form but then I'd
have to change the whole design of how the queries are run.

What are these queries? As a rule users should never even SEE a query
datasheet, and only in unusual circumstances should they even see the name of
a query. Action queries have their place but having a user select from a list
of action queries to execute would be very unusual.

What happens when the "queries are run"? What does the user see? What's the
context?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top