Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Choosing either one customer or all customers

Status
Not open for further replies.

snowyowl

Programmer
Dec 16, 2002
16
GB
Hello all
Does anyone know how to run a report from a selection screen that allows either one customer to be selected or all customers to be selected.

I have a drop down list for the customer name and also a check button that says all customers. My problem occurs when I try to run the query. On the customer number I usually have as criteria

[Forms]![Select Job Status Information]![Combo16]

Combo16 is the drop down on the form. But how do I put a condition around this when the all customers button is selected ?
Should I try wildcards or just run two different reports which are identical appart from them having two different queries behind them ?
 
Rick,

I'm confused by that FAQ. The first column has numbers and a * in it. Is it text? If so, what if you have more than nine items in there? When there are double digit numbers, Like '1' is going to pull up too many records, no?

The way I do it is similar, except that I use a zero instead of an *. Then, in the code behind the button I use to open the form/report, I set the recordsource dynamically, with an if statement testing for a value of 0 in there--if it is zero, I don't append that part of the WHERE clause.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Professional Development for Clients Large and Small

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top