Link to home
Start Free TrialLog in
Avatar of tgfo4927
tgfo4927

asked on

Adding a Parameter choice or everything

I have created a report that has a parameter for Vendor ID - but how do I let the user choose a vendor or display all the vendors.  I've tried using * in the query filter but no luck.  The parameter is requiring me to enter a vendor number and returns an error if I leave it blank.
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Without looking at your report, couple of options:
(1)  Create a new report that has as it's recordsource the same SQL but without the parameter, so it returns all rows
(2)  Create a 'dummy' parameter that menas return all rows (-1, 0 are typical), then change the report's RecordSource so that it does something like this:

    SELECT Everyone
    FROM Vendors
    WHERE (VendorID = @VendorID OR @VendorID = -1)
Avatar of tgfo4927
tgfo4927

ASKER

I don't want to have 2 different reports - The users should have the option to choose a vendor or not.

What do you mean create a dummy parameter?  do I do that in the query?
ASKER CERTIFIED SOLUTION
Avatar of meumax
meumax

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Perfect solution!