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

Report type question

Status
Not open for further replies.

Klo

Technical User
Aug 28, 2002
86
US
I have a report in Access 2000 that shows test results. Some of these results have upper and lower limits. For example the result might be 4.8 with normal range of 4.1-4.7. How can I add a field to the report that will print "HIGH" if above or "LOW" if below the limits? Would this be done with VBA or in the report query?
Thanks
 
In design view
place a textbox on to the form, then in place the code below in the Report
If [Your field name] = > 4.7 then
textbox = "high"
end if
If [Your field name] = < 4.1 then
textbox = "low"
end if


Hope this helps
Hymn
 
Hi Hymn,
I'm Missing something basic. I put an unbound textbox in the report but seem to get stuck after that. Please speak slow and basic.
 
Your unbound textbox say it is called textbox20? and the field that shows the result in the Report is called Range? then

If [range] > 4.7 then
textbox20 = "high"
end if
If [range] = < 4.1 then
textbo20x = "low"
end if

if you need more help please ask


Hope this helps
Hymn
 
place the code in the Report's Detail On Format event

PaulF
 
I assume you have a table holding limits for each type of measurement; generally, you would use a separate table of measurement types and including fields for upper and lower limits. In your report, the record source would be a query that includes the limits from linked measurement category type table. With each record now having limits data, you can add a text box to your report in detail section (if listing measurements), and insert an expression (function) that tests the actual vs. the limits. My first thought is use IIF function IIF([Actual]>[Upper],"High",IIF([Actual]<[Lower],"Low","")).
Not sure I've got exact picture of your situation, but hope this helps.
Jeff
 
Thanks guys, all the info helped. I finally got it to work. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top