Hej
Jeg har fået lavet en funktion til at finde stien til en fil i access,
og den virker fint men den kan ikke vise filerne med
koden .filters.add "xxxx", "*.*" der melder access fejl.
Sub getFileName()
Dim fileName As String
Dim result As Integer
With Application.FileDialog(msoFileDialogFolderPicker)
.Title = "Vælg billede til database"
.Filters.Add "Alle filer", "*.*"
.Filters.Add "JPEG-filer", "*.jpg"
.Filters.Add "JPEG-filer", "*.jpeg"
.Filters.Add "Bitmap-filer", "*.bmp"
.FilterIndex = 4
.AllowMultiSelect = False
.InitialFileName = CurrentProject.Path
result = .Show
If (result <> 0) Then
fileName = Trim(.SelectedItems.Item(1))
Me![Image_PIC].Visible = True
Me![Image_PIC].SetFocus
Me![Image_PIC].Text = fileName
Me![Image_PIC].SetFocus
Me![Image_PIC].Visible = False
End If
End With
End Sub
Hilsen
Peter
|