David_W_R
asked on
How to set visible parameter of a control on a report in VBA
From a separate VB module, I open a Report in acPreview mode (or acViewDesign mode), and attempt to set the visibility of a control based on the value of another control in the same report per the code below.
DoCmd.OpenReport SummaryReportName, acPreview, , "HHID = " & ClientNowPrinting
Debug.Print "This should print"
Debug.Print "Text135 = " & [RpQtr - Performance131231Charts]!T ext135
Debug.Print "text199 visible = " & [RpQtr - Performance131231Charts]!T ext199.Vis ible
If [RpQtr - Performance131231Charts]!T ext135 <> 0 Then
[RpQtr -Performance131231Charts]! Text199.Vi sible = False
End If
The Report loads fine, and subsequently prints, but my attempt to set control visibility before printing is fruitless. Any line of code having the name of the report just seems to be ignored, even the debug.print commands. The "This should print" line does print in the Immediate window, but the lines following do not print. The variable SummaryReportName = "RpQtr - Performance131231Charts"
Is it not possible to read the value in controls of a Report and change them from code in another module? If it is possible, what am I doing wrong?
DoCmd.OpenReport SummaryReportName, acPreview, , "HHID = " & ClientNowPrinting
Debug.Print "This should print"
Debug.Print "Text135 = " & [RpQtr - Performance131231Charts]!T
Debug.Print "text199 visible = " & [RpQtr - Performance131231Charts]!T
If [RpQtr - Performance131231Charts]!T
[RpQtr -Performance131231Charts]!
End If
The Report loads fine, and subsequently prints, but my attempt to set control visibility before printing is fruitless. Any line of code having the name of the report just seems to be ignored, even the debug.print commands. The "This should print" line does print in the Immediate window, but the lines following do not print. The variable SummaryReportName = "RpQtr - Performance131231Charts"
Is it not possible to read the value in controls of a Report and change them from code in another module? If it is possible, what am I doing wrong?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER