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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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
 
Back
Top