I’m trying to figure out how to get a form to display a picture from a file. I have created a form, “Form1”, and on this form I place an image control, “Image4”
My program, in Mod1, has a global variable “PictureFileName$”
In the directory from which the database was launched, I have a jpeg file “Picture1.jpg”
Sub DisplayForm1(PictureFile As String)
PictureFileName$ = PictureFile
DoCmd.OpenForm "Form1"
End Sub
Below is the sub which runs when Form1 is loaded
Private Sub Form_Load()
Dim S$
S$ = CurrentProject.Path & "\" & PictureFileName$
'What code would go here to make here to make control "Image4" display
' the jpeg file with the name PictureFileName$
End Sub
Can anyone show me the code which should go into the above sub so that when I run the following
Sub Test1
DisplayForm1 “Picture1.jpg”
End sub
I will see Form1 with Picture1 showing in control Image4?
Thank you in advance.