Select multiple images and store their file paths and image names in text fields of ms access table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AS Mughal
    New Member
    • Feb 2022
    • 2

    #1

    Select multiple images and store their file paths and image names in text fields of ms access table

    i have an ms access form based on a table which has 4 text fields named Image_Path1, Image_Path2, Image_Path3 & Image_Path4. On the form i have 4 command buttons to select the images and store their file path and image name in corresponding text field of table. i use the following code behind the command button
    Code:
    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
    Next
    End If
    Set f = Nothing
    End Sub
    My Question is ...
    how i can i use only one command button to select all the four images and store their file path and image in one go ?
    The database is attachedhttp://www.4shared.com/s/fuhH73p7giq
    Thanks
Working...