J
Jo
Hi,
I have a simple access report that prints data based on a query. I have 6
bound textboxes tied to the fields from this query. My issue is: I am trying
to avoid displaying the textboxes when there is no value for them in the
database. These are basically dates and some of them don't have any data in
them. I want to avoid displaying such textboxes. So in the detail section's
on-print event I wrote the following code thinking that I will accomplish
this task. I can see the values in the debugger but not when the report has
finished printing on the screen? - the textboxes don't appear even when there
is data in them!!
Code to carry out hiding/displaying the textboxes:
If objRS("OPTION1") = " " Then
Me.lblOption1.Properties("Visible") = False
Me.txtOpt1Start.Properties("Visible") = False
Me.txtOpt1End.Properties("Visible") = False
Me.lnOpt1.Properties("Visible") = False
ElseIf objRS("OPTION1") <> " " Then
Me.lblOption1.Properties("Visible") = True
Me.txtOpt1Start.Properties("Visible") = True
Me.txtOpt1End.Properties("Visible") = True
Me.lnOpt1.Properties("Visible") = True
End If
Instead of hiding/displaying such textboxes the textboxes are completely
hidden and only two textboxes appear for the base year date and the base year
end!
What is it that I am doing wrong here?Has a question like this answered
before? if so, could anyone of you please send me the link? Thanks in advance
for all your efforts.
Jo
I have a simple access report that prints data based on a query. I have 6
bound textboxes tied to the fields from this query. My issue is: I am trying
to avoid displaying the textboxes when there is no value for them in the
database. These are basically dates and some of them don't have any data in
them. I want to avoid displaying such textboxes. So in the detail section's
on-print event I wrote the following code thinking that I will accomplish
this task. I can see the values in the debugger but not when the report has
finished printing on the screen? - the textboxes don't appear even when there
is data in them!!
Code to carry out hiding/displaying the textboxes:
If objRS("OPTION1") = " " Then
Me.lblOption1.Properties("Visible") = False
Me.txtOpt1Start.Properties("Visible") = False
Me.txtOpt1End.Properties("Visible") = False
Me.lnOpt1.Properties("Visible") = False
ElseIf objRS("OPTION1") <> " " Then
Me.lblOption1.Properties("Visible") = True
Me.txtOpt1Start.Properties("Visible") = True
Me.txtOpt1End.Properties("Visible") = True
Me.lnOpt1.Properties("Visible") = True
End If
Instead of hiding/displaying such textboxes the textboxes are completely
hidden and only two textboxes appear for the base year date and the base year
end!
What is it that I am doing wrong here?Has a question like this answered
before? if so, could anyone of you please send me the link? Thanks in advance
for all your efforts.
Jo