Drag and drop and show file name only.

josros60

Registered User.
Local time
Today, 10:50
Joined
Mar 10, 2011
Messages
73
I have this code works fine, but when sending invoices will be easier to drag and drop the files being attached into a textbox because i use two monitors, also if just show the files names instead of folder in the textbox.

is it possible?

here it's the code:

Code:
Private Sub btnBrowse_Click()
    Dim fileDiag As FileDialog
    
    Dim strFile As String
    Dim strFolder As String
    Dim file As Variant
    
    Set fileDiag = FileDialog(msoFileDialogFilePicker)
    
    fileDiag.AllowMultiSelect = True
    If fileDiag.Show Then
        For Each file In fileDiag.SelectedItems
            Me.txtAttachment = file
        Next
    End If

End Sub

thanks
 
Hmm, not sure what you are asking because you can't drag a file from Explorer and drop it into a Control on your Form but actually you would not have to. If you are sending eMail you can just include that path in the Attachments section.
 
You are probably not getting any responses because this is outside what you can normally do in Access. If you goggle "MS Access drag and drop" about the only thing that come up as a possibility is using a ListView Control. This doesn't look easy.
 

Users who are viewing this thread

Back
Top Bottom