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

I want a problem report to color code different faults

Status
Not open for further replies.

lewie

Technical User
Joined
Jan 17, 2003
Messages
94
Location
US
I have a query that checks for 3 error conditions. I have a report based on that query. What is the best way to include the condition that caused the record to be printed; on the report. Like green lines for one etc. I saw nothing in the query that could be used. would i have to restate the query in the report.
Thanks lewie
 
Post the SQL view of the query so we can see what you are doing.
 
SELECT Table1.name, Table1.city, Table1.birthday, Table1.[start date], Table1.[end date], Table2.[guide start], Table2.[guide end]
FROM Table1 INNER JOIN Table2 ON Table1.[guide start] = Table2.[guide start]
WHERE (((Table1.[start date])>[table2]![guide start])) OR (((Table1.[end date])<[table2]![guide end]));

This one only checks for start dates too late or end dates too early and lists them in a report. I would like a way to label the problem like green lines have a bad start date and red lines have a bad end date.
 
You'll have to add an error number or text to the queries like this: 1 as ErrorCode, Table1.name, ...

Then union the queries for your report and use the OnFormat event of the report detail section to change the background color of a control using VBA (probably with a Case statement).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top