I am building a bridal registry db have a report which displays three records per page. I am trying to display a unique image for each record (i.e. three different images per report page). If no image exists for the record, my code is supposed to display a filler image. The problem I'm having is that I can only get one common image to display for all three records at a time. I believe this is the case because I have only one image frame (Bride_Groom_Frame) for the report and my code is displaying the same image in the same frame for each record! This same code works fine on my forms where I only have one image displayed at a time.
Here is my code:
Private Sub Display_Pic()
Dim Pic_Path As String
On Error GoTo Err_Display_Pic
Pic_Path = "c:\Pictures\"
Me!Bride_Groom_Frame.Picture = Pic_Path & "3" & ".jpg"
'Me!Bride_Groom_Frame.Picture = Me![Path] & [Registry_ID] & ".jpg"
Exit Sub
Err_Display_Pic:
'Me!Bride_Groom_Frame.Picture = Me![Path] & "Bride_Groom" & ".jpg"
Exit Sub
End Sub
Another problem I have is that my db has a unique picture path tied to each type of picture. When I use the Me![Path} statement though, the code won't display the image for some reason. It acts like the path is wrong but I'm not sure why. That is why the non-rem'd statement has the [Pic_Path] and "3" entries instead of the Me![Path] and Me![Registry_ID].
Any help would be appreciated.
Thanks!
Here is my code:
Private Sub Display_Pic()
Dim Pic_Path As String
On Error GoTo Err_Display_Pic
Pic_Path = "c:\Pictures\"
Me!Bride_Groom_Frame.Picture = Pic_Path & "3" & ".jpg"
'Me!Bride_Groom_Frame.Picture = Me![Path] & [Registry_ID] & ".jpg"
Exit Sub
Err_Display_Pic:
'Me!Bride_Groom_Frame.Picture = Me![Path] & "Bride_Groom" & ".jpg"
Exit Sub
End Sub
Another problem I have is that my db has a unique picture path tied to each type of picture. When I use the Me![Path} statement though, the code won't display the image for some reason. It acts like the path is wrong but I'm not sure why. That is why the non-rem'd statement has the [Pic_Path] and "3" entries instead of the Me![Path] and Me![Registry_ID].
Any help would be appreciated.
Thanks!