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

Need to exclude field on report if field is blank 1

Status
Not open for further replies.

JSD

Technical User
Jan 18, 2002
189
US
I would be thankful if someone can help me. I'm trying to print a report for records with 5 fields of criteria. The 5th field is a 'notes' field, so I only want it to show on the report if there were notes entered into that field. I also need to know how to exclude the text label for 'notes' when there are none. Thanks...
 
Hi

In the onformat event of the report:

If Len(Trim(Nz(txtNotes,""))) = 0 Then
txtNotes.Viisble = False
lblNotes.Visible = False
Else
txtNotes.Visible = True
lblNotes.Visible = True
End if

using your own control names of course
Hope this helps

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Hi

OOPS meant to say:

In the onformat event of the relevant section of the report:

Hope this helps

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Thanks for the code. I tried to put the code in the OnOpen event because I couldn't find an onformat event in the report properties. When I tried opening the report, I got an error message stating "run-time error 424, coul not find object" I tried to debug, and it highlights the "txtNotes.Visible = False." Do I need the report name?
Is that the object it is looking for? The name of my control is "Notes", and it's label is "Notes_Label."

Getting very close...
 
Hi

No, like I said in my correcting post, you put it in the onformat event of the relevant section.

So if it is the detail section of the report, select the 'bar' identifying the beigining of he detail section, in properties look for on format, it is there
Hope this helps

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top