This looks very professional. I don't have Access 2002, so I can't look it up. Some hints to help you find it yourself, maybe:
- Check the whole module you copied this sub from for the define (dim mso.. as ....). Variables can be defined outside subroutines.
- Or it might be a global variable, defined by some module, to be found in the module tab. But I think the first is the more likely.
- Check the help for FileDialog action of Application-object. This might give an example and an explanation.
I think somebody else will come along with the full answer, but this may help you in the mean time.
Hope this helps.
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???
' 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
.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].Text = fileName
Me![ImagePath].Visible = False
thanks in advance