Solved

"Compile error: User-defined type not defined" - adh_accOfficeGetFileNameInfo

Posted on 2009-07-15
3
877 Views
Last Modified: 2013-11-27
Borrowing code from a Access DB I developed some time back, I'm trying to allow users to select the directory where the file for import resides.  In my old DB, it still works fine.  However, in my new DB, I get a COMPILE ERROR (included in the title).  I have gone through and verified References, and all are identical in both DBs.  Can anyone tell me why, when I try to DIM a variable, adh_accOfficeGetFileNameInfo will not show as one of my choices, while it does in my old DB?  And a recommended course of action?  Any assistance would be greatly appreciated.  Thanks in advance.
Public Function gfni_getFile()
Dim gfni As adh_accOfficeGetFileNameInfo
With gfni
    .hwndOwner = Application.hWndAccessApp
    .strAppName = "Select Location of File for Import"
    .strDlgTitle = "Select Location of File For Import"
    .strOpenTitle = "Select"
    .strfile = "*.mdb"
    .strInitialDir = "\\server\directory\folder"
    .strFilter = "Access Database (*.mdb)|All Files (*.*)|Excel Spreadsheet (*.xls)"
    .lngFilterIndex = 1
    .lngView = adhcGfniViewList
    .lngFlags = adhcGfniNoChangeDir Or adhcGfniInitializeView
End With
 
If adhOfficeGetFileName(gfni, True) = adhcAccErrSuccess Then
    gfni_getMTOE = Trim(gfni.strfile)
End If
End Function

Open in new window

0
Comment
Question by:tebert0411
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 75
ID: 24861094
You are missing part of the code from Getz's app ... mainly the part the defines

adh_accOfficeGetFileNameInfo

mx
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 250 total points
ID: 24861109
That  code goes in the Declaration section of a standard vba module, along with several other similar declarations related to the file browse.

mx
0
 

Author Closing Comment

by:tebert0411
ID: 31603827
Thanks for the reminder.  As stated previously, I've been out of the mix for a while.  Forgot all about the declarations.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question