Greetings, all
I am developing a Microsoft Access 2000 database (on Windows XP) that will have a report with images. (Two different images on the same page in the end, but that's perhaps a future post.) I'm using an image frame to display images and a text box to concatinate the file path/name. Through a lot of trial and error, message board interaction/review, MS Knowledge base review, etc., I came up with some code that worked well for a previous project that I did a couple of years ago. I thought I could use the same exact code for this new project, but for some reason the report doesn't want to show the jpgs. Actually, the "no picture available" jpg will display, but the record-specific saved jpgs won't. It seems to at least be looking in the right place, as the photos are all in the same folder.
If I remove the error trap in the code, I get a "run-time error 2220" message that says it can't open the jpg file. Just because I'm curious, I copied the "no picture available" jpg (since it will display that) and renamed as the file name it's telling me it can't open. This did not solve the problem, as I continue to get the same message with the same file name.
Sorry for the long-winded post, but I thought I would try to answer your potentially most basic questions up front.
Please consider, my code skills were enough to cobble things together in a workable fashion to this point, rather than creating great new compositions. The code I'm using is below. Thanks a million for your consideration.
Best regards,
- Johnette
Option Compare Database
Private Sub Form_Current()
On Error Resume Next
Me![Photo2].Picture = Me![PhotoName2]
End Sub
Sub PhotoName2_AfterUpdate()
On Error Resume Next
Me![Photo2].OLETypeAllowed = 1
Me![Photo2].SourceDoc = Me![PhotoName2]
Me![Photo2].Action = 0
End Sub
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim strNoPicFile As String
strNoPicFile = "P:\070064 - Wash West Historic District\Database\Survey Photos\NoPicFile.jpg"
On Error GoTo Err_Detail_Format
If IsNull(Me!PhotoName2) = False Then
Me![Photo2].Picture = Me![PhotoName2]
End If
Exit_Detail_Format:
Exit Sub
Err_Detail_Format:
Select Case Err.Number
Case 2220
Me![Photo2].Picture = strNoPicFile
End Select
Resume Next
End Sub
I am developing a Microsoft Access 2000 database (on Windows XP) that will have a report with images. (Two different images on the same page in the end, but that's perhaps a future post.) I'm using an image frame to display images and a text box to concatinate the file path/name. Through a lot of trial and error, message board interaction/review, MS Knowledge base review, etc., I came up with some code that worked well for a previous project that I did a couple of years ago. I thought I could use the same exact code for this new project, but for some reason the report doesn't want to show the jpgs. Actually, the "no picture available" jpg will display, but the record-specific saved jpgs won't. It seems to at least be looking in the right place, as the photos are all in the same folder.
If I remove the error trap in the code, I get a "run-time error 2220" message that says it can't open the jpg file. Just because I'm curious, I copied the "no picture available" jpg (since it will display that) and renamed as the file name it's telling me it can't open. This did not solve the problem, as I continue to get the same message with the same file name.
Sorry for the long-winded post, but I thought I would try to answer your potentially most basic questions up front.
Please consider, my code skills were enough to cobble things together in a workable fashion to this point, rather than creating great new compositions. The code I'm using is below. Thanks a million for your consideration.
Best regards,
- Johnette
Option Compare Database
Private Sub Form_Current()
On Error Resume Next
Me![Photo2].Picture = Me![PhotoName2]
End Sub
Sub PhotoName2_AfterUpdate()
On Error Resume Next
Me![Photo2].OLETypeAllowed = 1
Me![Photo2].SourceDoc = Me![PhotoName2]
Me![Photo2].Action = 0
End Sub
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim strNoPicFile As String
strNoPicFile = "P:\070064 - Wash West Historic District\Database\Survey Photos\NoPicFile.jpg"
On Error GoTo Err_Detail_Format
If IsNull(Me!PhotoName2) = False Then
Me![Photo2].Picture = Me![PhotoName2]
End If
Exit_Detail_Format:
Exit Sub
Err_Detail_Format:
Select Case Err.Number
Case 2220
Me![Photo2].Picture = strNoPicFile
End Select
Resume Next
End Sub