Compile error

SheaLee

Registered User.
Local time
Today, 12:30
Joined
Dec 22, 2005
Messages
40
Compile error: "User-defined type not defined"
I split my database (Access2k) and then went into the front end to test my forms, now I'm getting the compile error, the form has a multi list select box (which I got from this wonderful site) and then you press a button to preview a report, when I press the button the Visual basic debugger window appears and with the compile error:
On Error GoTo Err_cmdOpenQuery_Click
Dim MyDB As DAO.Database
Dim qdef As DAO.QueryDef
Dim I As Integer
Dim strSQL As String
Dim strWhere As String
Dim strIN As String
Dim flgSelectAll As Boolean
Dim varItem As Variant

Set MyDB = CurrentDb()
I read some of the previous threads regarding compile errors, but I'm still stuck. Hope someone can shad some light on this...
 
I am guessing that you are missing the DAO reference. Check for missing references in any module in the db. Replace any that have MISSING listed at the top of the list.
 
ADO vs. DAO (or A97 vs. V2K)

you we're correct, I was missing the DAO reference, but I still wasn't sure how to reference it to my database, so I took your advice and did a search on Google and dude you are sooooo right it is a great place to get info.
What I found on google was a write up from Applecore Pages on Microsoft Access www.applecore99.com/gen/gen019.asp ADO vs. DAO (or A97 vs. V2K) I and I'll quote from the page


The steps to ensure that A97 code will work in A2K is: Set a reference to DAO in the database:
**press Ctl-G to bring up the debug window
**then select Tools|References. Add a reference to the appropriate version of DAO, which is currently 3.6.

**Dim rsADO As ADODB.Recordset
**Dim rsDAO As DAO.Recordset

Thank again
 
SheaLee said:
you we're correct, I was missing the DAO reference, but I still wasn't sure how to reference it to my database, so I took your advice and did a search on Google and dude you are sooooo right it is a great place to get info.
Happy to hear that somebody knows how to search for themselves and I am glad you fixed your problem. Keep up the good work!
 

Users who are viewing this thread

Back
Top Bottom