what do i use in access 2000 to get a file open dialog box ??

hi guys,
in my access 2003 application, i use the following to get a file open dialog, but it does not work in access 2000.
does anyone have some code to replace what i am currently using ?

here is the code in access 2003, i need code for access 2000.

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 The FoundationCrawlSpace 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![Photo1].Value = -1
            Form_FoundationCrawlSpace.ImageFrame.Visible = True
            Form_FoundationCrawlSpace.ImagePath.Visible = False
        End If
    End With

End Sub
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

What error do you get trying to run this code?  Is it possible that you have missing references in your Access 2000 application?  Open a VBA module and got to Tools -> References and verify that nothing is labeled MISSING.  If you do have missing references, you will need to update  them with the correct version.

You can also try this API File open function... It has worked well for me in regardless of Access Version:

To clarify what you need to do for the code at that URL...

Copy everything between these two lines  and paste in a module, called for  example modDirectorysearch

'***************** Code Start **************

'************** Code End *****************

Then to get a filename from the windows file open dialog, just call it like this:

dim strFileName as string
strFileName = ahtCommonFileOpenSave( _
                OpenFile:=True, _
                DialogTitle:="Please select an input file...", _

kevinsreaAuthor Commented:
the reason the access 2003 code that i have does not work, is that the routine was not available to access 2000.

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Give the API code at the URL I posted a try.  That should work for you.
kevinsreaAuthor Commented:
ok,, it seems to be working.., how do i modify the code so it just looks for the filetype   .jpg and   .gif ?



substitute the following line
strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS")

with these two lines
strFilter = ahtAddFilterItem(strFilter, "jpeg files (*.jpg)", "*.jpg")
strFilter = ahtAddFilterItem(strFilter, "gif files (*.gif)", "*.gif")

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kevinsreaAuthor Commented:
excellent mr.natchiket..
just one more question.. let's say that i wanted have a path already set in another text box,
and i can get that value from the text box.., and then add it onto the lookup feature for the .jpg or .gif file,
how would i add that value of the text box.,.
let's say that the text box was set to    "c:\pictures"

kevinsreaAuthor Commented:
oh,, never mind.. i figured it out..

thanks guys !!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.