Select from 2 Combo boxes on a form and print the report

A

ashfire

Hi, i have a form that shows Week Numbers and Areas. I have a report for this
too. I also have had this working for one combo box (but the BEEEEEPS werent
happy)

The code i used for the one combo box is

DoCmd.OpenReport stDocName, acPreview, , "([Weekly Horizon]='" &
Me!CmbWeek.Column(0) & "')"

Unfortunately this only filters the Report by Week Number, i need to add an
Area criteria too

Hope that made some sense
 
S

SteveM

Try this, changing the field and combo names to match your own:
DoCmd.OpenReport stDocName, acPreview, , "[Weekly Horizon]='" &
Me!CmbWeek.Column(0) & "' AND [AreaField] = " & Me!CmbArea.Column(0)

Note: Text values require '' single quotes, Date values require octothorpes
##, Numeric values don't require anything around the supplied value.

Steve
 
A

ashfire

Perfect, thanks a lot

SteveM said:
Try this, changing the field and combo names to match your own:
DoCmd.OpenReport stDocName, acPreview, , "[Weekly Horizon]='" &
Me!CmbWeek.Column(0) & "' AND [AreaField] = " & Me!CmbArea.Column(0)

Note: Text values require '' single quotes, Date values require octothorpes
##, Numeric values don't require anything around the supplied value.

Steve

ashfire said:
Hi, i have a form that shows Week Numbers and Areas. I have a report for this
too. I also have had this working for one combo box (but the BEEEEEPS werent
happy)

The code i used for the one combo box is

DoCmd.OpenReport stDocName, acPreview, , "([Weekly Horizon]='" &
Me!CmbWeek.Column(0) & "')"

Unfortunately this only filters the Report by Week Number, i need to add an
Area criteria too

Hope that made some sense
 

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