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

Hiding fields if not needed in a report

Status
Not open for further replies.

CMooreJr

Technical User
Feb 20, 2003
217
US
Hey all! I have a report that is pulling Projects and lawson numbers(model numbers). This report is running off of a query "qry_signage_verification" that pulls from 2 tables, "project_manager" and "tbl_lawson_numbers". My problem is this...

One project may have 1 lawson number, or it may have 10. Each Lawson number needs 3 "check boxes" to appear on the report beside the number. How can I have these check boxes appear IF there is a Lawson number, but NOT APPEAR if there isn't a lawson number? These boxes are only used to check off when completed, so they store no data. I know I can draw the boxes in, but if there is only one lawson number, I dont want 30 boxes. can you help?

(By the way, I know it probably isn't the best way, but the lawson numbers are divided up in the table by lawson_nbr1, lawson_nbr2, etc.)

Thanks!!!
 
Hi

Put the boxes on the report and name them

in the onformat event of the appropriate section of the report (probably the detail section from your explanation), but VBA code so

If IsNull(LawsonNo1) Then
Box1.visible = false
else
Box1.visible = True
End if
and so on for box2, box3 etc, using your own control/column names of course

you could further automate this with a for loop, but the general idea is the same
Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
PERFECT! That will work great! 1 question, there will be multiple projects on the form, since the fields are actually "hidden", will the second project appear at the end of alot of empty space if there is only 1 lawson number? If so, can I correct that somehow?

Thanks a bunch!
 
Hi

Yes it will

You can adjust this by setting the .left property of the visible box(es) in the onformat event Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top