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

Report to only display records based on value of calculated field

Status
Not open for further replies.

jethro11

Programmer
Sep 11, 2002
18
US
Hi,
I've set up a report to monitor daily shift activity reports and check compliance to federal standards for environmental pollution. The report does some calculations for Charge lbs/hour and checks it against a predefined standard. If it is in compliance it puts a value 'OK' in another field(Status) or else it puts a value of 'NOT OK'. Eg

Date Charge lbs/hour Status
06/01/2003 18,250 OK
06/03/2003 31,000 NOT OK
06/04/2003 17,500 OK

Is there a way that I can only get the report to display non compliant records where status is "NOT OK"?? If everything is OK, the report could say "All records in compliance" or something like that. Thanks for the help!

 
#1) you can put your calculations of OK and NOT OK into the query/recordsource of the report. then in the criteria of that STATUS field, put "NOT OK", then those will be the only ones showing. you'd then delete your currently calculated STATUS text boxes on the report cause they dont really mean anything any more (since everything on the report is NOT OK)

#2) there is an event in the Report Properties called On No Data. you could put something like:

Code:
msgbox "Everything is OK!", vbokonly, "Status"
docmd.CancelEvent

so it doesn't open the report-it just pops up a message box that everything is ok.

hope that helps.

g
 
GingerR,
Thanks for your helpful tip, it worked! Wonder why I didn't think of it? I appreciate your help with my problem immensely!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top