Displaying Labels

  • Thread starter Thread starter Hershey
  • Start date Start date
H

Hershey

Guest
I have a report in which I want to print the labels only for the fields that contain data.
In other words, if the field has no data (or is null), I do not want the labels for these fields to print. I know it will take some
coding, but I'm having trouble with it.
Can anyone help?
 
On the report event "On open" try this:
If control1 & "A" = "A" then 'Control1 is empty
Label1.visible = false
else
Label1.visible = true
end if

Hope this helps you, Stefano
 
I tried this, but it's still not hiding
the label. I even tried this:

If IsNull(Me!FirstChild) Then
Me!Label16.Visible = False
Else
Me!Label16.Visible = True


and This:

If IsNull(Me!FirstChild.Value) Then
Me!Label16.Visible = False
Else
Me!Label16.Visible = True

HELP!!
 
Sorry Hershey, I spent lots of days with my pc off; try to open your report in design mode, use the previous code, printout, and finally close the report.
Commands you need are:
DoCmd.OpenReport "Myreport", acViewDesign
........... (prevoius code)
DoCmd.PrintOut
DoCmd.Close acReport, "Myreport", acSaveNo

using this code you are able to modify the visible property of your labels
Bye, Stefano
 

Users who are viewing this thread

Back
Top Bottom