Using a command button

  • Thread starter Thread starter hotplate
  • Start date Start date
H

hotplate

How do I take the value from a drop down list and use it for the
criteria for a report of a query when I press a command button?
 
One way I've done this is to create a table that holds the Access report
name, and a user-friendly report name that corresponds.

I use a query of that table to fill the combo box, hiding the first column
(Access report name) and showing the second.

When the user picks a report, the command button runs code something like:

DoCmd.OpenReport Me.cboMyComboBox

with the report name that is in the first (bound) column of the combo box.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 
I guess I asked the question wrong. I am just trying to use the value
from a drop down list to use it for a query criteria.
 
hotplate wrote on 31/07/2006 :
How do I take the value from a drop down list and use it for the
criteria for a report of a query when I press a command button?

what is your vba code to call the query?

grtz
 
I am going to have to read some more of the book Access for dummies.
Thanks for the help
 
In your query, in the criterion row under the field, put a reference to the
form & combobox. It will look something like:

Forms!YourFormName!YourComboBoxName

(substitute your form's name and your combo box's name).

Note that this requires that the bound value/column in the combo box is what
you need for the parameter/criterion.

Note2: you can use the wizard in the query design mode to help you select
the form and combo box.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 
Back
Top