C
Clint Marshall
I'm struggling to control whether a text box in a subreport prints. I'm
trying to set the control's visible property (using VBA) to true or false
depending on the value of the control.
I'm doing this because depending on the record I'm dealing with, only one of
two fields will appear and I want to show different data depending on the
data in one of the two fields.
Unfortunately, I can't seem to get access to the value of the control from
within VBA. Despite trying many different formats to access the value, I
get either a"can't find the field" or a "has no value" error.
I've tried things like: If [txtValue] is null then...
If me.[txtValue] is null then...
If Query.qrySR1.[txtValue] is null then...
Report: rptReport1
SubReport: rptSR1
Query used in report: qryReport1
Query used in subreport: qrySR1
Field from query qrySR1 whose value I'm trying to access (also the control
name): txtValue
Here are some specific questions:
1) Is controlling the control's visible property from VBA the appropriate
way to show or hide a control in a report?
2) If so, under what event should I be placing my code?
3) How do I access the variable's value? What is the proper code to address
the value?
4) How else can I accomplish this?
Thank you!
-Clint Marshall
trying to set the control's visible property (using VBA) to true or false
depending on the value of the control.
I'm doing this because depending on the record I'm dealing with, only one of
two fields will appear and I want to show different data depending on the
data in one of the two fields.
Unfortunately, I can't seem to get access to the value of the control from
within VBA. Despite trying many different formats to access the value, I
get either a"can't find the field" or a "has no value" error.
I've tried things like: If [txtValue] is null then...
If me.[txtValue] is null then...
If Query.qrySR1.[txtValue] is null then...
Report: rptReport1
SubReport: rptSR1
Query used in report: qryReport1
Query used in subreport: qrySR1
Field from query qrySR1 whose value I'm trying to access (also the control
name): txtValue
Here are some specific questions:
1) Is controlling the control's visible property from VBA the appropriate
way to show or hide a control in a report?
2) If so, under what event should I be placing my code?
3) How do I access the variable's value? What is the proper code to address
the value?
4) How else can I accomplish this?
Thank you!
-Clint Marshall