Public Function PicturePicker() As String
Dim fd As Office.FileDialog
'Set fd = Application.FileDialog(msoFileDialogFolderPicker)
Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
.Title = "Select a Picture"
.Filters.Clear
.Filters.Add "Image file", "*.ani;*.bmp;*.gif;*.ico;*.jpe;*.jpeg;*.jpg;*.pcx;*.png;*.psd;*.tga;*.tif;*.tiff;*.webp;*.wmf, 1"
.Filters.Add "All files", "*.*", 2
.AllowMultiSelect = False
If .Show = -1 Then
PicturePicker = (.SelectedItems(1))
End If
End With
Set fd = Nothing
End Function
Private Sub CmdAddPicture_Click()
Dim strPicture As String
strPicture = PicturePicker
Me.CmdAddPicture.Caption = "Upload Picture"
If Len(strPicture) > 0 Then
With Me
Me.txtImagEmployee = strPicture
Me.Dirty = False
Me.EmpImage.Requery
End With
End If
End Sub