J
John
I copied some code from the northwind database to my new
database. I developed a form like the employees form in
northwind db the code for the add/change and remove
buttons is what i copied ....no other code was in my db
on my form I started fresh...well the code that i copied
is all the code in the employees form for all the events
needed. well i go to run my form and push the add/change
button and the compile error comes up with the (variable
not defined error) Here is the variable it talks about
not being defined(msoFileDialogFilePicker) here is the
code.How do I define the variable
Sub getFileName()
' Displays the Office File Open dialog to choose a
file name
' for the current employee record. If the user
selects a file
' display it in the image control.
Dim fileName As String
Dim result As Integer
With Application.FileDialog(msoFileDialogFilePicker)
.Title = "Select Employee 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].SetFocus
Me![ImagePath].Text = fileName
Me![FirstName].SetFocus
Me![ImagePath].Visible = False
End If
End With
End Sub
thanks in advance
John
database. I developed a form like the employees form in
northwind db the code for the add/change and remove
buttons is what i copied ....no other code was in my db
on my form I started fresh...well the code that i copied
is all the code in the employees form for all the events
needed. well i go to run my form and push the add/change
button and the compile error comes up with the (variable
not defined error) Here is the variable it talks about
not being defined(msoFileDialogFilePicker) here is the
code.How do I define the variable
Sub getFileName()
' Displays the Office File Open dialog to choose a
file name
' for the current employee record. If the user
selects a file
' display it in the image control.
Dim fileName As String
Dim result As Integer
With Application.FileDialog(msoFileDialogFilePicker)
.Title = "Select Employee 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].SetFocus
Me![ImagePath].Text = fileName
Me![FirstName].SetFocus
Me![ImagePath].Visible = False
End If
End With
End Sub
thanks in advance
John