Load multi-attachements in various attachments in form

Asked

Viewed 178 times

0

I am trying to create a function to upload multiple files at the same time but I think because I am choosing the next function does not actually attach the file but creates a preview.

In my optics I think what’s wrong with the code is:

Me.Anexo412.DefaultPicture = Selectfile

And apart from that I need to load up to 8 files (max) simultaneously because there are 8 maximum files that can be attached in this form.

Here is the code for your analysis

'FILE DIALOG OPENS UPLOAD PANEL
Private Sub Comando715_Click()
Call Selectfile
End Sub
'FUNÇÃO CAIXA DE SELEÇÃO
Public Function Selectfile() As String
Dim Fd As FileDialog
Dim Filtro As FileDialogFilters
Set Fd = Application.FileDialog(msoFileDialogOpen)
With Fd
'FILTRO DE IMAGENS
Set Filtro = .Filters
With Filtro
.Clear
.Add "Imagens", "*.jpeg;*.jpg"
End With
'NÃO PERMITIR MULTI-SELEÇÃO
.AllowMultiSelect = True
'DEFINE O NOME DA CAIXA DE SELEÇÃO
.Title = " Por favor introduza as fotos da peça"
If .Show = True Then
'CODIGO DE COLOCAÇÃO DE ANEXO EM FORMULÁRIO
Selectfile = .SelectedItems(1)
Me.Anexo412.DefaultPicture = Selectfile
Else
MsgBox "Clicou no botão cancelar ao escolher imagem."
Exit Function
End If
Set Fd = Nothing
End With
End Function

Can any of you help me in this matter?

  • @Can you help me out?

  • I tried this code Me.Anexo412 = Selectfile Doesn’t does Anything.... I tried the code Me.Anexo.DefaultPicture = Selectfile Can anyone Give me some idea how to do it? I’ve read a Lot of internet posts but cant find the Answer. Any Ideas.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.