Image on reports (1 Viewer)

jsargent1986

New member
Local time
Yesterday, 22:48
Joined
Jun 28, 2017
Messages
1
I have a task at work that involves updating the access database that holds our authorized service companies. This is a simple database with 1 table, 1 query and 1 report. I have limited Access knowledge and my company is aware of that but gave me the task anyways. I have managed to update the info and make changes to the database and report, and even made a form to update the table when needed. :) I am using Access 2016

Now the challenge....

We have some companies that are preferred over others by our parent company and my boss would like the preferred member logo to appear by certain companies on the report. I already have them marked with a check box but cannot seem to figure out how to get the logo to appear only with the checked companies. I figure it is going to be a VBA programming thing that I have no idea about:banghead: (I know some python, thats it).

The report contains 180 companies of which about half need the logo. Any help appreciated. My boss knows my limited knowledge of this and is not expecting a miracle. It is more for me to learn something. (I work in a tech service call center, not IT. But do have an IT background so not a complete idiot)
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 03:48
Joined
Jan 14, 2017
Messages
18,212
In the detail section of your report make sure the checkbox field is included as well as an image control

Lets call them chkPreferred & imgPreferred
Add the image to the image control

The checkbox is of course bound to the preferred member field (Yes/No field)

Next set the image control as hidden i.e. Visible=False
Unless you want to see it, you can set the checkbox to hidden as well

Now add code to the Detail_Format event as follows:

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
   If Me.chkPreferred=True Then Me.imgPreferred.Visible=True
End Sub

The image will only appear if the checkbox is ticked (even if the checkbox itself is not visible)
 

Users who are viewing this thread

Top Bottom