A
angie
i have entered the following code in the on open event of my report where
"PHOTO"=image in detail section and "ImageText"= jpeg name of the image.
Option Compare Database
Option Explicit
Dim filename As String, pathname As String
Dim db As Database
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.PHOTO.Picture = pathname & "\" & Me.ImageText
End Sub
Private Sub Report_Open(Cancel As Integer)
'find the path of the current database
'which is where the jpegs are stored
Set db = CurrentDb
filename = db.Name
pathname = Mid(filename, 1, Len(filename) - Len(Dir(filename)))
End Sub
i have placed the same code in on current event of a form and it works fine.
what is the problem with the report?
i would also like to avoid putting the code in the on open event because i
want to assign a macro there, could i put the code in the on activate event?
"PHOTO"=image in detail section and "ImageText"= jpeg name of the image.
Option Compare Database
Option Explicit
Dim filename As String, pathname As String
Dim db As Database
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.PHOTO.Picture = pathname & "\" & Me.ImageText
End Sub
Private Sub Report_Open(Cancel As Integer)
'find the path of the current database
'which is where the jpegs are stored
Set db = CurrentDb
filename = db.Name
pathname = Mid(filename, 1, Len(filename) - Len(Dir(filename)))
End Sub
i have placed the same code in on current event of a form and it works fine.
what is the problem with the report?
i would also like to avoid putting the code in the on open event because i
want to assign a macro there, could i put the code in the on activate event?