ncalcaterra
Programmer
I have a form (fUploadImages_Batch). The form contains 3 objects:
txtPhotoBy
txtPhotoDate
btnBatchLoad
The record source of the form is a table called "tImages" and contains the following fields:
ItemId = AutoNumber
PhotoBy = Text(255)
PhotoDate = Date/Time
ImgFileName = Text(255)
ImgDetail = OLE Object
DetailWidth = Number (Long Int)
DetailHeight = Number (Long Int)
ImgThumbnail = OLE Object
ThumbWidth = Number (Long Int)
ThumbHeight = Number (Long Int)
The following code is for the btnBatchLoad in the fUploadImages_Batch form:
Option Compare Database
Option Explicit
' Batch-Load button clicked: Load an entire folder of images (into new records)
Private Sub btnBatchLoad_Click()
On Error GoTo Finish
Dim strFile As String
Dim strFullPath As String
Dim strFolderName As String
' Display a 'Browse for folder' dialog - see 'BrowseForFolder' module
strFolderName = BrowseFolder("Select folder to load images from")
If Not IsEmpty(strFolderName) And Not strFolderName = "" Then
strFile = Dir(strFolderName + "\" + "*.jpg", vbNormal)
While (Not StrComp(strFile, ""))
If Len(strFile) > 1 Then
strFullPath = strFolderName + "\" + strFile
DoCmd.GoToRecord , , acNewRec
If DBPixMain.ImageLoadFile(strFullPath) Then
= strFile
End If
End If
strFile = Dir
Wend
End If
Finish:
End Sub
Everything works great, the image is uploaded both as an original as well as a thumbnail version and their height/width of each. Also uploaded into a separate field is the actual filename itself (ImgFileName).
The btnBatchLoad uploads all images contained in the directory selected.
Here is my issue:
I would like to enter the PhotoBy and PhotoDate in the text fields on the form, click the Batch Load command button and have the PhotoBy and PhotoDate values from the form be added to the table for ALL the images uploaded in the batch upload. I was able to get it to add the values to the first photo, but not the remaining photos.
Any help would be great - thanks to all.
txtPhotoBy
txtPhotoDate
btnBatchLoad
The record source of the form is a table called "tImages" and contains the following fields:
ItemId = AutoNumber
PhotoBy = Text(255)
PhotoDate = Date/Time
ImgFileName = Text(255)
ImgDetail = OLE Object
DetailWidth = Number (Long Int)
DetailHeight = Number (Long Int)
ImgThumbnail = OLE Object
ThumbWidth = Number (Long Int)
ThumbHeight = Number (Long Int)
The following code is for the btnBatchLoad in the fUploadImages_Batch form:
Option Compare Database
Option Explicit
' Batch-Load button clicked: Load an entire folder of images (into new records)
Private Sub btnBatchLoad_Click()
On Error GoTo Finish
Dim strFile As String
Dim strFullPath As String
Dim strFolderName As String
' Display a 'Browse for folder' dialog - see 'BrowseForFolder' module
strFolderName = BrowseFolder("Select folder to load images from")
If Not IsEmpty(strFolderName) And Not strFolderName = "" Then
strFile = Dir(strFolderName + "\" + "*.jpg", vbNormal)
While (Not StrComp(strFile, ""))
If Len(strFile) > 1 Then
strFullPath = strFolderName + "\" + strFile
DoCmd.GoToRecord , , acNewRec
If DBPixMain.ImageLoadFile(strFullPath) Then
End If
End If
strFile = Dir
Wend
End If
Finish:
End Sub
Everything works great, the image is uploaded both as an original as well as a thumbnail version and their height/width of each. Also uploaded into a separate field is the actual filename itself (ImgFileName).
The btnBatchLoad uploads all images contained in the directory selected.
Here is my issue:
I would like to enter the PhotoBy and PhotoDate in the text fields on the form, click the Batch Load command button and have the PhotoBy and PhotoDate values from the form be added to the table for ALL the images uploaded in the batch upload. I was able to get it to add the values to the first photo, but not the remaining photos.
Any help would be great - thanks to all.