Hi
I have an ms access table having 4 text fields to store 4 image path and image names. i use a form to store the image paths and image names in these text fields. For this i use 4 different command buttons to select image from computer and store the image path and image file name in each text field separately.
What i want is that whether i can use just one command button on form to select all the 4 images and store their image path and image name in one go (instead of using 4 command buttons for each of 4 text fields)
the code behind the command button in available in the attached ms access database
as well as as under
Thanks....
I have an ms access table having 4 text fields to store 4 image path and image names. i use a form to store the image paths and image names in these text fields. For this i use 4 different command buttons to select image from computer and store the image path and image file name in each text field separately.
What i want is that whether i can use just one command button on form to select all the 4 images and store their image path and image name in one go (instead of using 4 command buttons for each of 4 text fields)
the code behind the command button in available in the attached ms access database
as well as as under
Code:
Private Sub Command23_Click()
Dim f As Object
Dim strfile As String
Dim varItem As Variant
Set f = Application.FileDialog(3)
f.allowMultiSelect = True
If f.show Then
For Each varItem In f.selectedItems
strfile = Dir(varItem)
strfolder = Left(varItem, Len(varItem) - Len(strfile))
MsgBox "Folder" & strfolder & vbCrLf & "File: " & strfile
Me.Image_Path1 = strfolder + strfile 'Textfield of table
Next
End If
Set f = Nothing
End Sub