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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determining if record exists

Status
Not open for further replies.

BryanLane

Technical User
Apr 28, 2008
52
US
I am using Crystal 11.5.8.826

I have a report that allows the user to see which customers have special pricing for an item. There are parameters for Supplier and Part Number. The report then lists all customers who have special pricing where cntr_price.sup = {?Supplier} and cntr_price.part = {?PartNumber}.

If they enter a correct Sup and Part combination the report works properly. If there isn't a record in the cntr_price table for the item I have a formula in Detail b that says "No contract pricing for this item." I suppress the item if there is pricing and then suppress blank section is checked for Detail b to suppress it if there is a price.

My concern is if they type in an invalid Supplier and/or Part Number the report could mislead them into thinking there is no contract pricing. I need to be able to test the Supplier and Part provided by the user against the Inventory Master table (InvMas.Sup and InvMas.Part) and if the part does not exist then return a message saying that combination does not exist.

It is always easier to show that something exists than to prove it doesn't...

"The problems we face today cannot be solved by the minds that created them."
--Albert Einstein
 
YOu can create dynamic parameters, which provide lists of suppliers and part numbers from your Inventory Master table (InvMas.Sup and InvMas.Part).

Then user can only select valid numbers.

Ian
 
The users will be running the report through a
"Crystal Report Viewer", that apparently does not support dynamic parameters. I played around with them in the report this morning and they work great within Crystal itself, but when I run it through the Viewer it doesn't respect the parameter and will allow the entry of values that are not already in the table.


"The problems we face today cannot be solved by the minds that created them."
--Albert Einstein
 
You could add two subreports that each linked on a parameter from the main report to the corresponding master table in the subreport. In the sub, suppress all sections except the report header and add a formula there, like this:

if isnull({table.employeeID}) then
"Invalid Employee ID Selection"

Repeat for the other parameter.

-LB
 
I concatanated InvMas.Sup and InvMas.Part and to create @Item and then put the formula:

if isnull ({@Item}) then "Invalid Sup and/or Part" in the Header of my subreport.

Thanks for the suggestion LBass.

"The problems we face today cannot be solved by the minds that created them."
--Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top