I use the Access 2002 Office Object 10.0 library FileDialog to find the filepath of images I link to a database. However, whenever I try and run this using runtime (after packaged) the application crashes on a runtime error. The code is as follows:

Dim fileName As String
Dim result As Integer
With Application.FileDialog(msoFileDialogOpen)
.Title = "Select Product Picture"
.Filters.Add "All Files", "*.*"
.Filters.Add "JPEGs", "*.jpg"
.Filters.Add "Bitmaps", "*.bmp"
.FilterIndex = 3
.AllowMultiSelect = False
.InitialFileName = CurrentProject.path
result = .Show
If (result <> 0) Then
fileName = Trim(.SelectedItems.Item(1))
Me![IMAGEPATH].Visible = True
Me![IMAGEPATH].Text = fileName
Me![IMAGEPATH].Visible = False
End If
End With
End Sub

The error appears to be happening at this point: With Application.FileDialog(msoFileDialogOpen)

If anyone else has had similar problems or knows of some way to circumvent the FileDialog within this code I'd appreciate any advice.