make item invisible in report if condition met

G

Guest

I want to be able to make a check box invisible on a report if it is unchecked.
I think I may be able to do this through the Detail_Format code section of
the report.

Essentially I want something like this (psuedocode)

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Me.FollowUp = Unchecked Then
Me.FollowUp.Visible = False
End If

End Sub

There is no visible property for an element on a report. Can this be done?
Any assistance is appreciated.
 
D

Duane Hookom

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.FollowUp.Visible = (Me.FollowUp=True)
End Sub
 
A

Allen Browne

You can use the Visible property as you suggest, even though it does not
show up in the intellisense list.

However, there's a much more efficient and neater solution that involves no
code at all. See:
Check boxes in reports
at:
http://allenbrowne.com/ser-52.html

The article explains how to replace the text box with a text box, and set
the Format property to display whatever you want, e.g. checked or crossed
box, with or without border.
 
G

Guest

Sorry, Didn't work.

Got an error "Method or data member not found".
And is highlighting the second part of the Me.FollowUp=True.
There also doesn't appear to be a valid visible property from the "smart
code" help box.


--
I may not know VBA inside out, but from the outside I am looking in.
Dylan Moran - Melbourne Australia


Duane Hookom said:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.FollowUp.Visible = (Me.FollowUp=True)
End Sub
 
D

Duane Hookom

Do you have a check box control named FollowUp?

--
Duane Hookom
MS Access MVP


Dylan Moran said:
Sorry, Didn't work.

Got an error "Method or data member not found".
And is highlighting the second part of the Me.FollowUp=True.
There also doesn't appear to be a valid visible property from the "smart
code" help box.
 
G

Guest

Nope no, followup cpntrol, txtFollowUp on the other hand. :)
Changed the name, felt silly, and all worked ok.
Thanks Duane.

Also thanks again Allen, excellent. Have changed all my check boxes to text
boxes and everything is much friendlier to design.

Regards
Dylan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top