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_accOfficeGetFileNameIn fo 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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the reminder. As stated previously, I've been out of the mix for a while. Forgot all about the declarations.
adh_accOfficeGetFileNameIn
mx