Conditional Labels?????? (1 Viewer)

JustMaybe

Registered User.
Local time
Today, 09:48
Joined
Oct 18, 2002
Messages
134
Hi, I’ve got a bit of a weird problem which could possibly be solved with the following solution:
However I don’t even know if it is do-able!! Does anyone know if it is possible to have a label appear on a report, conditionally by a check box being checked on a form?? If so does anyone have any guidance or ideas on how this would be done??
Thanks in advance for any ideas or advice!!!
 

ColinEssex

Old registered user
Local time
Today, 09:48
Joined
Feb 22, 2002
Messages
9,132
Hi Sara

Just thinking quickly- assuming that the form is open when you run the report. Put this code in the OnOpen event of the report.

If Forms!FormName!CheckBoxName = -1 Then

Me.LabelName.Visible = True

Else

Me.LabelName.Visible = False

End If


Col




:cool:
 

JustMaybe

Registered User.
Local time
Today, 09:48
Joined
Oct 18, 2002
Messages
134
Col, again you have been a star!!! thank you v.much!!! That has helped so much!!!!

Sarahx

for anyone who needs to use this the code is (tiny, slight difference from above!)

Private Sub Report_Open(Cancel As Integer)

If Forms!Orders!YourCheckBox.Value = True Then

Me![LabelName].Visible = True

Else

Me![LabelName].Visible = False

End If

End Sub
 

ColinEssex

Old registered user
Local time
Today, 09:48
Joined
Feb 22, 2002
Messages
9,132
Hi Sarah

I was very close though !!;)

Col
:cool:
 

sonnierock

Registered User.
Local time
Today, 09:48
Joined
Aug 6, 2002
Messages
11
The above solution is based on Form. What if the condition is based on Query.

If record 1(of an table) have a field Apple that is true then in the report the picture of an Apple be visible??
 

sonnierock

Registered User.
Local time
Today, 09:48
Joined
Aug 6, 2002
Messages
11
I figure it out

Private Sub Detail1_Print(Cancel As Integer, PrintCount As Integer)

If Me![Apple] = True Then
Me![Image377].Visible = True
Else
Me![Image377].Visible = False
End If

End Sub



Oh MAN
 

Users who are viewing this thread

Top Bottom