On my form I have a image control and it is bound to a default image path of where the databse backend is and the Image file name in a folder called images. I use the file dialog to collect the file name for the image I am needing.
When I take pictures they go to a folder called ImagesTemp. This is a temporary holding folder as I have to rename the image file before putting it in the main folder called Images by the BackEnd. After taking the image I open the file dialog and while in there I just change the name quickly and then select the file for the file name to be put into my form for the database.
So while the image is in the ImagesTemp Folder and has not been sent over to the main folder yet my image control is blank. This is very confusing for the user as they do not rember if they put an image in yet or not. I could put up some checks to make sure they put images in but that is not what i would like to do. Sometimes it could take hours to a day or so to transfer the images so if the user wants to check back on an image to compare products the image is still blank.....
SO.... How can I get the database image control to source a certain path to ImagesTemp Folder and if the image file is not found there then source the main folder OR Vice Versa which I truly think I need. Thanks.
Private Sub Form_Current()
On Error GoTo ErrProc
Dim ImagePath As String
ImagePath = GetProductImageFilePath & Forms!frmSkusEntry!sbfrmProductImages.Form!ProductImageFileNm
If Len(Forms!frmSkusEntry!sbfrmProductImages.Form!ProductImageFileNm) > 0 And Len(Dir(ImagePath)) > 0 Then
Forms!frmSkusEntry!Image126.Picture = ImagePath
Forms!frmSkusEntry!Text160 = ImagePath
Forms!frmSkusEntry!Image126.Picture = "\\1-PC\OneDrive\Database\Images\Images Available Upon Request.jpg"
Forms!frmSkusEntry!Text160 = ""
Select Case Err.Number
Public Function GetProductImageFilePath() As String
GetProductImageFilePath = GetDBPath & "images\"
Public Function GetDBPath() As String
GetDBPath = Replace(CurrentDb.TableDefs("Assemblies").Connect, ";DATABASE=", "")
'Remove db name
GetDBPath = Left(GetDBPath, InStrRev(GetDBPath, "\"))