Link to home
Start Free TrialLog in
Avatar of tebert0411
tebert0411

asked on

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

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

Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

You are missing part of the code from Getz's app ... mainly the part the defines

adh_accOfficeGetFileNameInfo

mx
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tebert0411
tebert0411

ASKER

Thanks for the reminder.  As stated previously, I've been out of the mix for a while.  Forgot all about the declarations.