showing pictures in report

jmt90404

Registered User.
Local time
Today, 13:40
Joined
Mar 24, 2018
Messages
29
Please excuse my poor explanation as I'm still very new to Access and VBA.

I've created a report that is basically a to-do list with a number of tasks that the user needs to complete. one of the columns in the report is a priority field where on another form the user can change the priority of the task to either a 1, 2, or 3. I would like the report, instead of showing 1, 2, or 3 to show a specific picture assigned to each number. I was trying to accomplish this by using a combo box with the 2nd column having the link to the pictures but I can't figure it out. Any help will be greatly appreciated!
 
Are the images inside your database or elsewhere?

Easiest may be to have all three images on your report in the same location. Set their visible property to false. In the On Format event, check your priority and make the proper image visible. Something like

If Me.Priority = 1 then me.Image_1.visible = true
If Me.Priority = 2 then me.Image_2.visible = true
If Me.Priority = 3 then me.Image_3.visible = true
 
Currently the pictures are not in the database. I tried the suggestion but none of the pictures seem to appear. I put the code in the On Format event for the Detail section. What am I missing?
 
Please post your code so we can see what is happening. Also, put a msgbox in prior to doing any testing and have it tell you what your value is for priority. Remember, ACCESS will redo your source to match what fields/sorting/grouping you use in your report, so if you do not actually have priority on your report detail ACCESS may consider it null.
 
I do have the priority field in the detail section. One thing I neglected to mention is that I want the pictures to be visible when viewed on screen. I have noticed that with the below code the pictures are visible only during print preview only.

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.txtPriority = 1 Then
    Me.Image1.Visible = True
Else
    Me.Image1.Visible = False
End If
End Sub
 
Additionally, the report is in a navigation form. Not sure if that matters.
 
Format event does not Fire on Report View.
 
Yes, I realize that now. Where should the code go?
 
I don’t want to use a form as I am using grouping and sorting in the report. Is there no way to accomplish this task on a report?
 
I don’t want to use a form as I am using grouping and sorting in the report. Is there no way to accomplish this task on a report?

Yes but use print preview instead of report view to view on screen.
 
I’d prefer not to have to use print preview. Is there no way to accomplish this on a report in report view?
 
No. Images are not displayed in report view
 

Users who are viewing this thread

Back
Top Bottom