S
stumpy
the following code worked in office xp but i cannot seem to get it to work in
access 2007
Any help would be appreciated
Regards Rob.
Sub getFileName()
Dim fileName As String
Dim result As Integer
With Application.FileDialog(MsoFileDialogOpen)
.Title = "Select Picture"
.AllowMultiSelect = False
.Filters.Clear
.Filters.Add "Images", "*.jpeg;*.jpg;*.bmp", 1
.Filters.Add "All Files", "*.*"
.InitialFileName = "C:\Users\Rob\My Pictures"
result = .Show
If (result <> 0) Then
fileName = Trim(.SelectedItems.Item(1))
Me![ImagePath].Visible = True
Me![ImagePath].SetFocus
Me![ImagePath].Text = fileName
Me![Exit].SetFocus
Me![ImagePath].Visible = False
End If
End With
End Sub
access 2007
Any help would be appreciated
Regards Rob.
Sub getFileName()
Dim fileName As String
Dim result As Integer
With Application.FileDialog(MsoFileDialogOpen)
.Title = "Select Picture"
.AllowMultiSelect = False
.Filters.Clear
.Filters.Add "Images", "*.jpeg;*.jpg;*.bmp", 1
.Filters.Add "All Files", "*.*"
.InitialFileName = "C:\Users\Rob\My Pictures"
result = .Show
If (result <> 0) Then
fileName = Trim(.SelectedItems.Item(1))
Me![ImagePath].Visible = True
Me![ImagePath].SetFocus
Me![ImagePath].Text = fileName
Me![Exit].SetFocus
Me![ImagePath].Visible = False
End If
End With
End Sub