Label text show/hide condition with check box value

meenctg

Learn24bd
Local time
Tomorrow, 05:49
Joined
May 8, 2012
Messages
133
I have a report base on my table. Here a check box. I wanna show two label text hide/show base on when check is true or false. It will be when report will be open. I have try this but nothing is happened. Please any body help me

Code:
If AffecteAc= True Then 
affected.Visible = True
general.Visible = False
End If
 
You can't do it in the Open event of the Report. You need to use it in the ON FORMAT event of the section where those controls are located. Also, use the ME keyword before the control names like in this code below. Also, you can shorten your code and get rid of the If just by doing it like this below.

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
   Me.affected.Visible = Me.AffecteAc
   Me.general.Visible = Not Me.AffecteAc
End Sub
 

Users who are viewing this thread

Back
Top Bottom