I have a report on which two controls are not to be visible if the Yes/No field STOCKDISC is false. I have tried the second code routine in report open, the report does not print. I then tried the same routine in report activate. The report ran, but the two controls still appeared when STOCKDISC was false. How do I get the two controls to be invisible if STOCKDISC is false?
Robert
Robert
Code:
[FONT=Arial]Private Sub Report_Activate()[/FONT]
[FONT=Arial]If [STOCKDISC] = False Then[/FONT]
[FONT=Arial] Me.STOCKDISC.Visible = False[/FONT]
[FONT=Arial] Me.LabelStock.Visible = False[/FONT]
[FONT=Arial] End If[/FONT]
[FONT=Arial]End Sub[/FONT]
[FONT=Arial] [/FONT]
[FONT=Arial]Private Sub Report_Open(Cancel As Integer)[/FONT]
[FONT=Arial] If [STOCKDISC] = False Then[/FONT]
[FONT=Arial] Me.STOCKDISC.Visible = False[/FONT]
[FONT=Arial] Me.LabelStock.Visible = False[/FONT]
[FONT=Arial] End If[/FONT]
[FONT=Arial] [/FONT]
[FONT=Arial]End Sub[/FONT]