How to Add Images Based on Field Value?

boydrj

New member
Local time
Yesterday, 22:25
Joined
Sep 26, 2012
Messages
2
Hello everyone,

I am new here. I am currently building a trend report in Access. What I am trying to do is add up or down arrows based on the trends going up or down from month to month.

I created a text box with the expression:

=IIf([APRIL12]>[MAY12],"Down","Up")

What I want to do is add a picture for "Up" or "Down" based on how this expression comes out. I have uploaded my up and down pics to the table as OLE objects (up.bmp, down.bmp).

I have tried many different ways to get this to work, but I am stuck. Has anyone tried this or something similar? Any help would be greatly appreciated.

Also, I am really new to Access so don't have too much experience with coding, etc.

Thanks for any help I can get.
 
Drop images on your form. Set their visible properties to 'false.' An image has a PictureData property. Now you can swap PictureData properties from image control to image control....
Code:
private sub form_current()
  if something < somethingelse then 
    me.visibleimage.picturedata = me.hiddenupimage.picturedata
  else
    me.visibleimage.picturedata = me.hiddendownimage.picturedata
  end if
end sub
 

Users who are viewing this thread

Back
Top Bottom