Murray Brown
asked on
Access VBA change an image on a different form
Hi. I have two forms. The first loads an image in the following event. The second has a button where the image can be edited. My problem
is that when I do this and go back to the first form the old image is there. I have tried to reload the image and refresh the form but it doesn't work
is that when I do this and go back to the first form the old image is there. I have tried to reload the image and refresh the form but it doesn't work
Private Sub Form_Current()
Dim oDB_Folder As String: oDB_Folder = CurrentProject.Path
Dim oSavedPath As String: oSavedPath = [PhotoFile]
Dim oActualPath, F As String
F = Replace(oSavedPath, "DatabaseFolder", oDB_Folder)
Me.imgPhoto.Picture = F
End Sub
Private Sub btnSelectPhoto_Click()
Dim strFile As String
Dim PhotoFile As String
strFile = GetFileName(CurrentProject.Path)
If strFile > "" Then
PhotoFile = Filenm(strFile)
If Filepath(strFile) <> CurrentProject.Path & "\Media\ID Photos\" Then
FileCopy strFile, CurrentProject.Path & "\Media\ID Photos\" & PhotoFile
End If
imgPhoto.Picture = CurrentProject.Path & "\Media\ID Photos\" & PhotoFile
Me.PhotoFile = "DatabaseFolder" & "\Media\ID Photos\" & PhotoFile
Form_f_LicenseeDetailsEdit.PhotoFile = "DatabaseFolder" & "\Media\ID Photos\" & PhotoFile
Form_f_LicenseeDetailsEdit.Refresh
Form_f_LicenseeDetailsEdit.Repaint
End If
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the help
I think this
Open in new window
should beOpen in new window
e.g.Open in new window
Of course you can take a look at my Article and go the way of the BLOB : https://www.experts-exchange.com/articles/33716/Defeating-the-device-independent-bitmap-dib-format.html