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!

Optional field selection in Report template.

Status
Not open for further replies.

David693

Programmer
Jan 23, 2003
4
CA
I use the Access Report template to output contractor pay statements for a job I do in the forest industry. One report template is used to print many statements (naturally). Several lines are made of string fields and double fields as in the following :
Example 1:
Species/Grade Volume
============= ========
Baslam sawlogs 12345.67
Cedar sawlogs 0.00
Hemlock sawlogs 899.04
Spruce sawlogs 0.00
========
Totals 13244.71 cubic meters

(Note - things line up better in the template!)
So, Balsam sawlogs, Cedar sawlogs, etc. are referenced from tables with text fields; 12345.67, 0.00, etc. are referenced from double fields in the same tables. Species/Grade,===========, etc. are just text fields created in the immediate report.
My question - is it possible to omit the lines with 0.00 volume and "pull up" the lines that follow to appear like this :
Example 2:
Species/Grade Volume
============= ========
Baslam sawlogs 12345.67
Hemlock sawlogs 899.04
========
Totals 13244.71 cubic meters

Lines to be omitted would vary with each statement, depending on the data of course.
I would be most grateful (and impressed!) for any help you bright lights can shed on this for me. Thanks in advance.

David693.


 
Assuming your report is based on a query, include a &quot;<>0&quot; criteria against your volume field in that query. Lines with zero volume will not therefore appear in your base data for the report, and will not be printed!

If your report is based on a table, change its record source to a query based on the table with the criteria above.

Aidan Hughes
 
Thanks Aidan Hughes, for your help. Actually, your answer made me realize that I have structured my table incorrectly, and that, once a basic change is made, your tip will work. See, I had made the several species_grade & volume fields ALL PART OF ONE RECORD.
Example:
Invoice SPG1 VOL1 SPG2 VOL2 SPG3 VOL3, etc.
So, my problem was caused by trying to print separate lines for each non-zero field pair. All I have to do is change my table structure to a more 'normalized' one something like this :
Example:
Invoice Species-Grade Volume

Anyway, we try things and we learn new things. &quot;Some fun huh, Bambi?&quot;

Regards,
David693 2thumbsup
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top