Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2003
    Posts
    138

    Unanswered: VBA Code error for displaying images

    I am atteptimg to display images in my database, just as the Northwind database does. I copied the code exactly all of my field names match but I keep getting this error.
    I have seen other suggestions about ensuring that there is a reference to Microsoft Library 10.0 but that is not an option in my list. Any suggestions?

    Compile Error: Varibale Not defined

    It occurs at this point of the code

    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

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    It's rather obvious that your puking happens on the "With Application.FileDialog(msoFileDialogFilePicker)" line ... What version of acces are you running? I think that Ver 10 is A2002 or A XP ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Dec 2003
    Posts
    138
    Office Professional 2003 with Windows prof XP

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Well ... What library do you have referenced?
    Back to Access ... ADO is not the way to go for speed ...

  5. #5
    Join Date
    Dec 2003
    Posts
    138
    11.0 object library, and DAO 3.6 object library, the same one's that are selected when I open the northwind. The northwind works fine so why won't it work with mine?

  6. #6
    Join Date
    Dec 2003
    Posts
    138
    Ok I got it to work by referncing Microsoft Office 11.0 however my picture only displays a corner if on Clip and if I use zoom or stretch the color is very distorted.

  7. #7
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Where (what line) is the actual error on? I was only guessing by process of elimination ... Also, try compiling the app and check your refs after for anything MISSING:
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •