List in a Query

C

Chris

I have recently name a query and it is working how it should. However one
thing that I would like to add to it is a dropdown list of things to choose
from when it prompts me for information. Does anyone know how to set that
up? Is it something that I need to add to the SQL?? The SQL that I
currently use is shown below.

SELECT SecurityGroupNames.SecurtyGroupName, CompleteList.UserName
FROM SecurityGroupNames INNER JOIN CompleteList ON
SecurityGroupNames.SecurityGroupNamesID = CompleteList.SecurtyGroupName
WHERE (((SecurityGroupNames.SecurtyGroupName)=[Please enter Security Group]));
 
K

KARL DEWEY

Use a form with a combo and reference it like this in the query --
[Forms]![YourFormName]![Combo5]

You can also use wildcards --
Like [Forms]![YourFormName]![Combo5] & "*"
OR
Like "*" & [Forms]![YourFormName]![Combo5] & "*"
OR
Like "*" & [Forms]![YourFormName]![Combo5]
 
C

Chris

I am sorry so I enter this where? Under the criteria in the design view? or
something?

KARL DEWEY said:
Use a form with a combo and reference it like this in the query --
[Forms]![YourFormName]![Combo5]

You can also use wildcards --
Like [Forms]![YourFormName]![Combo5] & "*"
OR
Like "*" & [Forms]![YourFormName]![Combo5] & "*"
OR
Like "*" & [Forms]![YourFormName]![Combo5]

--
Build a little, test a little.


Chris said:
I have recently name a query and it is working how it should. However one
thing that I would like to add to it is a dropdown list of things to choose
from when it prompts me for information. Does anyone know how to set that
up? Is it something that I need to add to the SQL?? The SQL that I
currently use is shown below.

SELECT SecurityGroupNames.SecurtyGroupName, CompleteList.UserName
FROM SecurityGroupNames INNER JOIN CompleteList ON
SecurityGroupNames.SecurityGroupNamesID = CompleteList.SecurtyGroupName
WHERE (((SecurityGroupNames.SecurtyGroupName)=[Please enter Security Group]));
 
K

KARL DEWEY

Yep, but remeber the form must be open and contain a selection when the query
is run.
--
Build a little, test a little.


Chris said:
I am sorry so I enter this where? Under the criteria in the design view? or
something?

KARL DEWEY said:
Use a form with a combo and reference it like this in the query --
[Forms]![YourFormName]![Combo5]

You can also use wildcards --
Like [Forms]![YourFormName]![Combo5] & "*"
OR
Like "*" & [Forms]![YourFormName]![Combo5] & "*"
OR
Like "*" & [Forms]![YourFormName]![Combo5]

--
Build a little, test a little.


Chris said:
I have recently name a query and it is working how it should. However one
thing that I would like to add to it is a dropdown list of things to choose
from when it prompts me for information. Does anyone know how to set that
up? Is it something that I need to add to the SQL?? The SQL that I
currently use is shown below.

SELECT SecurityGroupNames.SecurtyGroupName, CompleteList.UserName
FROM SecurityGroupNames INNER JOIN CompleteList ON
SecurityGroupNames.SecurityGroupNamesID = CompleteList.SecurtyGroupName
WHERE (((SecurityGroupNames.SecurtyGroupName)=[Please enter Security Group]));
 
T

TP

Karl,

Is there any way to create the query so that it will open the form and allow
the user to make a selection from the dropdown, rather than having to open
the form first and make the selection, then run the query?

Thanks!!


KARL DEWEY said:
Yep, but remeber the form must be open and contain a selection when the
query
is run.
--
Build a little, test a little.


Chris said:
I am sorry so I enter this where? Under the criteria in the design view?
or
something?

KARL DEWEY said:
Use a form with a combo and reference it like this in the query --
[Forms]![YourFormName]![Combo5]

You can also use wildcards --
Like [Forms]![YourFormName]![Combo5] & "*"
OR
Like "*" & [Forms]![YourFormName]![Combo5] & "*"
OR
Like "*" & [Forms]![YourFormName]![Combo5]

--
Build a little, test a little.


:

I have recently name a query and it is working how it should.
However one
thing that I would like to add to it is a dropdown list of things to
choose
from when it prompts me for information. Does anyone know how to set
that
up? Is it something that I need to add to the SQL?? The SQL that I
currently use is shown below.

SELECT SecurityGroupNames.SecurtyGroupName, CompleteList.UserName
FROM SecurityGroupNames INNER JOIN CompleteList ON
SecurityGroupNames.SecurityGroupNamesID =
CompleteList.SecurtyGroupName
WHERE (((SecurityGroupNames.SecurtyGroupName)=[Please enter Security
Group]));
 
K

KARL DEWEY

I do not think you can put an event in a query but you can in the form so
that when you have made the selection (OnUpdate or OnChange) it will run the
query.
--
Build a little, test a little.


TP said:
Karl,

Is there any way to create the query so that it will open the form and allow
the user to make a selection from the dropdown, rather than having to open
the form first and make the selection, then run the query?

Thanks!!


KARL DEWEY said:
Yep, but remeber the form must be open and contain a selection when the
query
is run.
--
Build a little, test a little.


Chris said:
I am sorry so I enter this where? Under the criteria in the design view?
or
something?

:

Use a form with a combo and reference it like this in the query --
[Forms]![YourFormName]![Combo5]

You can also use wildcards --
Like [Forms]![YourFormName]![Combo5] & "*"
OR
Like "*" & [Forms]![YourFormName]![Combo5] & "*"
OR
Like "*" & [Forms]![YourFormName]![Combo5]

--
Build a little, test a little.


:

I have recently name a query and it is working how it should.
However one
thing that I would like to add to it is a dropdown list of things to
choose
from when it prompts me for information. Does anyone know how to set
that
up? Is it something that I need to add to the SQL?? The SQL that I
currently use is shown below.

SELECT SecurityGroupNames.SecurtyGroupName, CompleteList.UserName
FROM SecurityGroupNames INNER JOIN CompleteList ON
SecurityGroupNames.SecurityGroupNamesID =
CompleteList.SecurtyGroupName
WHERE (((SecurityGroupNames.SecurtyGroupName)=[Please enter Security
Group]));
 
T

TP

So if you wanted this functionality, you would:
1) create a query
2) create a form based on that query
3) modify the field in the form so that the dropdown would be available
4) create a condition for that field so when the dropdown is employed to
update to a new value, the entire form/query will be updated?

Sorry, I am by no means a programmer, and very much a BASIC user of Access
(plus I am working in Access 2003 vice 2007), creating simple Db's for my
employer when they request.

Your assistance is greatly appreciated.

KARL DEWEY said:
I do not think you can put an event in a query but you can in the form so
that when you have made the selection (OnUpdate or OnChange) it will run
the
query.
--
Build a little, test a little.


TP said:
Karl,

Is there any way to create the query so that it will open the form and
allow
the user to make a selection from the dropdown, rather than having to
open
the form first and make the selection, then run the query?

Thanks!!


KARL DEWEY said:
Yep, but remeber the form must be open and contain a selection when the
query
is run.
--
Build a little, test a little.


:

I am sorry so I enter this where? Under the criteria in the design
view?
or
something?

:

Use a form with a combo and reference it like this in the query --
[Forms]![YourFormName]![Combo5]

You can also use wildcards --
Like [Forms]![YourFormName]![Combo5] & "*"
OR
Like "*" & [Forms]![YourFormName]![Combo5] & "*"
OR
Like "*" & [Forms]![YourFormName]![Combo5]

--
Build a little, test a little.


:

I have recently name a query and it is working how it should.
However one
thing that I would like to add to it is a dropdown list of things
to
choose
from when it prompts me for information. Does anyone know how to
set
that
up? Is it something that I need to add to the SQL?? The SQL that
I
currently use is shown below.

SELECT SecurityGroupNames.SecurtyGroupName, CompleteList.UserName
FROM SecurityGroupNames INNER JOIN CompleteList ON
SecurityGroupNames.SecurityGroupNamesID =
CompleteList.SecurtyGroupName
WHERE (((SecurityGroupNames.SecurtyGroupName)=[Please enter
Security
Group]));
 
K

KARL DEWEY

Your 3) and 4) are wrong.
3) create a dropdown in the header of the form so as to make the selection
4) Use the dropdown as criteria in the query -
[Forms]![YourFormName]![DropDownName]
5) create an Event (OnUpdate or OnChange) or call a macro to Requery

--
Build a little, test a little.


TP said:
So if you wanted this functionality, you would:
1) create a query
2) create a form based on that query
3) modify the field in the form so that the dropdown would be available
4) create a condition for that field so when the dropdown is employed to
update to a new value, the entire form/query will be updated?

Sorry, I am by no means a programmer, and very much a BASIC user of Access
(plus I am working in Access 2003 vice 2007), creating simple Db's for my
employer when they request.

Your assistance is greatly appreciated.

KARL DEWEY said:
I do not think you can put an event in a query but you can in the form so
that when you have made the selection (OnUpdate or OnChange) it will run
the
query.
--
Build a little, test a little.


TP said:
Karl,

Is there any way to create the query so that it will open the form and
allow
the user to make a selection from the dropdown, rather than having to
open
the form first and make the selection, then run the query?

Thanks!!


Yep, but remeber the form must be open and contain a selection when the
query
is run.
--
Build a little, test a little.


:

I am sorry so I enter this where? Under the criteria in the design
view?
or
something?

:

Use a form with a combo and reference it like this in the query --
[Forms]![YourFormName]![Combo5]

You can also use wildcards --
Like [Forms]![YourFormName]![Combo5] & "*"
OR
Like "*" & [Forms]![YourFormName]![Combo5] & "*"
OR
Like "*" & [Forms]![YourFormName]![Combo5]

--
Build a little, test a little.


:

I have recently name a query and it is working how it should.
However one
thing that I would like to add to it is a dropdown list of things
to
choose
from when it prompts me for information. Does anyone know how to
set
that
up? Is it something that I need to add to the SQL?? The SQL that
I
currently use is shown below.

SELECT SecurityGroupNames.SecurtyGroupName, CompleteList.UserName
FROM SecurityGroupNames INNER JOIN CompleteList ON
SecurityGroupNames.SecurityGroupNamesID =
CompleteList.SecurtyGroupName
WHERE (((SecurityGroupNames.SecurtyGroupName)=[Please enter
Security
Group]));
 

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

Similar Threads


Top