Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with macros

Status
Not open for further replies.

sansari

Programmer
Oct 16, 2003
5
0
0
US
Hi .. this should be a relatively easy question for an access expert.. i need to have a form with a combo box and when i select one of the values from the list and press a button .. i want to see the report with that certain criteria. i'm using access 97.

so i have created a macro. i created a macro to set value of the underlying query criteria when the combo box is clicked. and then for the command button i created a macro which is to OpenReport based on that criteria that has been set already... its not really workng.. when i use it with a text box where i type out the criteria it works.. but i want to be able to just select the value from combo box.. i'm jsut wondering what the item and expression arguments should be set as for the combo box.. maybe thats causing the problem..

any help?!
 
You can do this fairly easily. First, set the criteria line for the appropriate field in your query to
=Forms!FormName!ComboBoxName

Then just have your button open the report. If the report is based on the query then the query will get the criteria from the Form and the Report will open with the proper filter.

Paul

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top