Combo Box Help

  • Thread starter Access lightweight
  • Start date
A

Access lightweight

I need help making access give me a combo box when i run the following query.
Right now, it just asks me for the two parameters...I want to be able to
select them from a menu.

SELECT [Tbl Main Serialized Parts].[Line Number], [Tbl Main Serialized
Parts].[Station #], [Tbl Main Serialized Parts].[Machine Name], [Tbl Main
Serialized Parts].[Serial # Assigned], [Tbl Main Serialized Parts].[Date
Installed], [Tbl Main Serialized Parts].[Date Removed], [Tbl Main Serialized
Parts].[Part Type], [Tbl Main Serialized Parts].[Warranty Replaced?]
FROM [Tbl Main Serialized Parts]
GROUP BY [Tbl Main Serialized Parts].[Line Number], [Tbl Main Serialized
Parts].[Station #], [Tbl Main Serialized Parts].[Machine Name], [Tbl Main
Serialized Parts].[Serial # Assigned], [Tbl Main Serialized Parts].[Date
Installed], [Tbl Main Serialized Parts].[Date Removed], [Tbl Main Serialized
Parts].[Part Type], [Tbl Main Serialized Parts].[Warranty Replaced?]
HAVING ((([Tbl Main Serialized Parts].[Line
Number])=[Forms]![FrmLineNumber]![Combo Box Line number]) AND (([Tbl Main
Serialized Parts].[Machine Name])=[Which Machine?]))
ORDER BY [Tbl Main Serialized Parts].[Station #], [Tbl Main Serialized
Parts].[Date Installed];


Thanks...
 
J

Jeff Boyce

Queries don't do comboboxes, forms do.

Create a form with a combo box listing the options for each of your two
paramaters.

Modify your query/SQL statement to refer to the (value in the) combobox on
the form with something like:

Forms!YourFormName!cboYourComboBoxName

Note that the form must be open and a selection made in the combobox for
this approach to work.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
A

Access lightweight

Jeff...seems like great instructions...they were easy to follow but when I
did them, it still just prompts me to enter a value for the parameter when I
run the Query?

Jeff Boyce said:
Queries don't do comboboxes, forms do.

Create a form with a combo box listing the options for each of your two
paramaters.

Modify your query/SQL statement to refer to the (value in the) combobox on
the form with something like:

Forms!YourFormName!cboYourComboBoxName

Note that the form must be open and a selection made in the combobox for
this approach to work.

Regards

Jeff Boyce
Microsoft Office/Access MVP

Access lightweight said:
I need help making access give me a combo box when i run the following
query.
Right now, it just asks me for the two parameters...I want to be able to
select them from a menu.

SELECT [Tbl Main Serialized Parts].[Line Number], [Tbl Main Serialized
Parts].[Station #], [Tbl Main Serialized Parts].[Machine Name], [Tbl Main
Serialized Parts].[Serial # Assigned], [Tbl Main Serialized Parts].[Date
Installed], [Tbl Main Serialized Parts].[Date Removed], [Tbl Main
Serialized
Parts].[Part Type], [Tbl Main Serialized Parts].[Warranty Replaced?]
FROM [Tbl Main Serialized Parts]
GROUP BY [Tbl Main Serialized Parts].[Line Number], [Tbl Main Serialized
Parts].[Station #], [Tbl Main Serialized Parts].[Machine Name], [Tbl Main
Serialized Parts].[Serial # Assigned], [Tbl Main Serialized Parts].[Date
Installed], [Tbl Main Serialized Parts].[Date Removed], [Tbl Main
Serialized
Parts].[Part Type], [Tbl Main Serialized Parts].[Warranty Replaced?]
HAVING ((([Tbl Main Serialized Parts].[Line
Number])=[Forms]![FrmLineNumber]![Combo Box Line number]) AND (([Tbl Main
Serialized Parts].[Machine Name])=[Which Machine?]))
ORDER BY [Tbl Main Serialized Parts].[Station #], [Tbl Main Serialized
Parts].[Date Installed];


Thanks...
 
J

Jeff Boyce

Please post the SQL statement of the query.

Open the query in design view, select the SQL view, copy/paste the SQL to
your response.

When my queries still "prompt" me, it's generally because I made a spelling
mistake.

Regards

Jeff Boyce
Microsoft Office/Access MVP

Access lightweight said:
Jeff...seems like great instructions...they were easy to follow but when I
did them, it still just prompts me to enter a value for the parameter when
I
run the Query?

Jeff Boyce said:
Queries don't do comboboxes, forms do.

Create a form with a combo box listing the options for each of your two
paramaters.

Modify your query/SQL statement to refer to the (value in the) combobox
on
the form with something like:

Forms!YourFormName!cboYourComboBoxName

Note that the form must be open and a selection made in the combobox for
this approach to work.

Regards

Jeff Boyce
Microsoft Office/Access MVP

in
message news:[email protected]...
I need help making access give me a combo box when i run the following
query.
Right now, it just asks me for the two parameters...I want to be able
to
select them from a menu.

SELECT [Tbl Main Serialized Parts].[Line Number], [Tbl Main Serialized
Parts].[Station #], [Tbl Main Serialized Parts].[Machine Name], [Tbl
Main
Serialized Parts].[Serial # Assigned], [Tbl Main Serialized
Parts].[Date
Installed], [Tbl Main Serialized Parts].[Date Removed], [Tbl Main
Serialized
Parts].[Part Type], [Tbl Main Serialized Parts].[Warranty Replaced?]
FROM [Tbl Main Serialized Parts]
GROUP BY [Tbl Main Serialized Parts].[Line Number], [Tbl Main
Serialized
Parts].[Station #], [Tbl Main Serialized Parts].[Machine Name], [Tbl
Main
Serialized Parts].[Serial # Assigned], [Tbl Main Serialized
Parts].[Date
Installed], [Tbl Main Serialized Parts].[Date Removed], [Tbl Main
Serialized
Parts].[Part Type], [Tbl Main Serialized Parts].[Warranty Replaced?]
HAVING ((([Tbl Main Serialized Parts].[Line
Number])=[Forms]![FrmLineNumber]![Combo Box Line number]) AND (([Tbl
Main
Serialized Parts].[Machine Name])=[Which Machine?]))
ORDER BY [Tbl Main Serialized Parts].[Station #], [Tbl Main Serialized
Parts].[Date Installed];


Thanks...
 
A

Access lightweight

Jeff...you are a steely eyed missle man. Thanks for all of the help...it
works gret...I had the name of the combo box wrong. I was using the name I
was displaying on the form not the actual name of the box. Thanks again!!!

Jeff Boyce said:
Please post the SQL statement of the query.

Open the query in design view, select the SQL view, copy/paste the SQL to
your response.

When my queries still "prompt" me, it's generally because I made a spelling
mistake.

Regards

Jeff Boyce
Microsoft Office/Access MVP

Access lightweight said:
Jeff...seems like great instructions...they were easy to follow but when I
did them, it still just prompts me to enter a value for the parameter when
I
run the Query?

Jeff Boyce said:
Queries don't do comboboxes, forms do.

Create a form with a combo box listing the options for each of your two
paramaters.

Modify your query/SQL statement to refer to the (value in the) combobox
on
the form with something like:

Forms!YourFormName!cboYourComboBoxName

Note that the form must be open and a selection made in the combobox for
this approach to work.

Regards

Jeff Boyce
Microsoft Office/Access MVP

in
message I need help making access give me a combo box when i run the following
query.
Right now, it just asks me for the two parameters...I want to be able
to
select them from a menu.

SELECT [Tbl Main Serialized Parts].[Line Number], [Tbl Main Serialized
Parts].[Station #], [Tbl Main Serialized Parts].[Machine Name], [Tbl
Main
Serialized Parts].[Serial # Assigned], [Tbl Main Serialized
Parts].[Date
Installed], [Tbl Main Serialized Parts].[Date Removed], [Tbl Main
Serialized
Parts].[Part Type], [Tbl Main Serialized Parts].[Warranty Replaced?]
FROM [Tbl Main Serialized Parts]
GROUP BY [Tbl Main Serialized Parts].[Line Number], [Tbl Main
Serialized
Parts].[Station #], [Tbl Main Serialized Parts].[Machine Name], [Tbl
Main
Serialized Parts].[Serial # Assigned], [Tbl Main Serialized
Parts].[Date
Installed], [Tbl Main Serialized Parts].[Date Removed], [Tbl Main
Serialized
Parts].[Part Type], [Tbl Main Serialized Parts].[Warranty Replaced?]
HAVING ((([Tbl Main Serialized Parts].[Line
Number])=[Forms]![FrmLineNumber]![Combo Box Line number]) AND (([Tbl
Main
Serialized Parts].[Machine Name])=[Which Machine?]))
ORDER BY [Tbl Main Serialized Parts].[Station #], [Tbl Main Serialized
Parts].[Date Installed];


Thanks...
 

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