Solved

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

Posted on 2009-07-15
3
883 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

623 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