entering criteria for parameters via listbox

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

Guest

I have a simple query that produces a report and prompts the user to enter a
criteria into a dialog box. I would like to make it easier for the user to
enter the criteria, by choosing from a drop down list rather than typing out
the entry. I would also like to allow more than one option to be chosen.
 
Allen:

Thanks. I don't seem to have the Northwinds database - or at least I can't
find it anywhere!. I tried adapting your instructions to my query but I'm not
sure whether Categories and CategoryID are variables already existing in the
database. I think once I know that i ought to be able to adapt your
instructions to my database.

Thanks.
 
I found the Northwinds database and followed your instructions.
Unfortunately, when I run the Report "Products By Category" no filter comes
up.
 
Did you open the report by clicking the command button on the form?

Temporarily comment out the error handler, by adding an apostrophy to line
2, i.e.:
'On Error Goto ...

Verify the code is running by adding these lines:
Debug.Print strWhere
Stop
just before the DoCmd.OpenReport line.

When it runs and stops, open the Immediate Window (Ctrl+G) and see if the
WhereCondition looks right. Then press F5 to let it continue.

After the report opens in the Immediate Window, enter:
? Reports(0).Filter
Does the filter string look correct?
 
Back
Top