entering criteria for parameters via listbox

J

Jeremy

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.
 
J

Jeremy

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.
 
J

Jeremy

I found the Northwinds database and followed your instructions.
Unfortunately, when I run the Report "Products By Category" no filter comes
up.
 
A

Allen Browne

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?
 

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