Show/Hide Image on a Report

rmead

Registered User.
Local time
Today, 04:21
Joined
Apr 17, 2007
Messages
15
Hi,

I have a field named 'Approved' which is a check box field - so a particular record can either be approved or unapproved. In my report that displays all the data for one particular record, I want to make visible an image given the condition that the field 'approved' is unchecked.

I am familiar with using the set property code / macros to accomplish this in a form, but I can not get it to work on a report. Any help would be appreciated.

Thanks!
 
on your report properties (in the detail section )
have this check box in it
then it will be
if Me!checkbox=true then fieldname.visible=true
if Me!checkbox=false then fieldname.visible=false

this should do it oh and an end if or two..
g
 
I understand that that is the code that I want, the problem I am having is where to put it, exactly.
 
this is easy but hard to describe

on your report in design mode
get below the header where it states detail
now properties
code
that should do it
 
an old Access guy told me when in reports use ! instead of .

not too sure why - but I have been doing what yopu are trying to do and have been using ! everywhere - which works fine
 
Got it now, thanks so much!

For some reason I was trying to make it happen on an event (I'm used to using macros for things instead of straight code), but once I figured out where to put it, everything worked as expected.

Again, thanks so much!

-Rob
 
Me.MyImage.Visible = Me.Approved = False
I don't think you can that syntax Rich (I've always run into trouble trying to use multiple = signs).

This should go in the On Format event of the detail section, or report (can't remember exactly where it's at and I currently don't have Access on the machine I sitting at, at work).
Code:
Me.YourImageControlName.Visible = Not Me!YourApprovalField

It uses "NOT" instead of just equals to, because you are wanting the image to appear if the checkbox is false, so the NOT operator changes the value to true for the display of the image.
 
rmead

which version worked??

I know mine does but did you try the others

g
 
I don't think you can that syntax Rich (I've always run into trouble trying to use multiple = signs).

Yes although I've never had any probs with this
Me.OLEUnbound29.Visible = Me.Type = "Reminder"
Me.OLEUnbound31.Visible = Me.Type = "2ndReminder"
Me.OLEUnbound32.Visible = Me.Type = "Notice"
Me.OLEUnbound33.Visible = Me.Type = "Further Action"
Me.OLEUnbound34.Visible = Me.Type = "Statement"
 

Users who are viewing this thread

Back
Top Bottom