F
froggie
Guest
help!!!
would you plz help me?
I wrote an access application,it did work on my computer, but when I copy it to other 4 computers and run it, system tell me : "compile error: undefined variable:msoFileDialogFilePicker". My computer and the 4 computers have the same hardware and software environment, they have the same operation system and same ms office version. The ms access on All of the 5 computer have been installed the same quote or object library:
visual basic for applications
ms access 9.0 object library
ms office 9.0 object library
ole automation
ms DAO 3.6 object library
what should I do? would you plz help me? my code is as follows:
------------------------------
Sub getFileName()
' display an office OpenFile dialog
' get a filename after user select a file from the office OpenFile dialog
' and put this picture file into an image object.
Dim fileName As String
Dim result As Integer
With Application.FileDialog(msoFileDialogFilePicker)
.Title = "select a picture"
.Filters.Add "all files", "*.*"
.Filters.Add "JPEGs", "*.jpg"
.Filters.Add "bitmap", "*.bmp"
.FilterIndex = 1
.AllowMultiSelect = False
.InitialFileName = CurrentProject.path
result = .Show
If (result <> 0) Then
fileName = Trim(.SelectedItems.Item(1))
Me![PicPath].Visible = True
Me![PicPath].SetFocus
Me![PicPath].Text = fileName
Me![PersonID].SetFocus
Me![PicPath].Visible = False
ErrorMessege.Visible = False
End If
End With
End Sub
would you plz help me?
I wrote an access application,it did work on my computer, but when I copy it to other 4 computers and run it, system tell me : "compile error: undefined variable:msoFileDialogFilePicker". My computer and the 4 computers have the same hardware and software environment, they have the same operation system and same ms office version. The ms access on All of the 5 computer have been installed the same quote or object library:
visual basic for applications
ms access 9.0 object library
ms office 9.0 object library
ole automation
ms DAO 3.6 object library
what should I do? would you plz help me? my code is as follows:
------------------------------
Sub getFileName()
' display an office OpenFile dialog
' get a filename after user select a file from the office OpenFile dialog
' and put this picture file into an image object.
Dim fileName As String
Dim result As Integer
With Application.FileDialog(msoFileDialogFilePicker)
.Title = "select a picture"
.Filters.Add "all files", "*.*"
.Filters.Add "JPEGs", "*.jpg"
.Filters.Add "bitmap", "*.bmp"
.FilterIndex = 1
.AllowMultiSelect = False
.InitialFileName = CurrentProject.path
result = .Show
If (result <> 0) Then
fileName = Trim(.SelectedItems.Item(1))
Me![PicPath].Visible = True
Me![PicPath].SetFocus
Me![PicPath].Text = fileName
Me![PersonID].SetFocus
Me![PicPath].Visible = False
ErrorMessege.Visible = False
End If
End With
End Sub