I usually do not post the same problem at multiple sites, but I am desperate for help.
I am looking for the code that will set all labels in the section of one report to not visible when the corresponding fields are empty.
The report is bound to a query populated by a form. Each form receives specific info for a different person and shows it on the appropriate report.
I can get the desired result with the following code, but only if used once ( the code is set in the OnFormat event procedure of the Detail section)
If Me. TextboxA = " " or IsNull (Me.TextboxA) Then
Me.LabelNameA. Visible = False
End if
If Textbox A is empty on form 1 than report 1 shows no label and box and when Textbox A has data on form 2 both will shows. Ok so far
If I enter the in the same procedure for Textbox B and enter only data on form 2, it will do the trick for report1 (no data, no label), but on report 2 it only shows the data (as expected) but the label is gone.
Question 1
Why is this happening?
Question 2
Can someone help me with a single code that would do the trick for all empty textboxes at the same time
Thank you
I am looking for the code that will set all labels in the section of one report to not visible when the corresponding fields are empty.
The report is bound to a query populated by a form. Each form receives specific info for a different person and shows it on the appropriate report.
I can get the desired result with the following code, but only if used once ( the code is set in the OnFormat event procedure of the Detail section)
If Me. TextboxA = " " or IsNull (Me.TextboxA) Then
Me.LabelNameA. Visible = False
End if
If Textbox A is empty on form 1 than report 1 shows no label and box and when Textbox A has data on form 2 both will shows. Ok so far
If I enter the in the same procedure for Textbox B and enter only data on form 2, it will do the trick for report1 (no data, no label), but on report 2 it only shows the data (as expected) but the label is gone.
Question 1
Why is this happening?
Question 2
Can someone help me with a single code that would do the trick for all empty textboxes at the same time
Thank you