user-defined type not defined - and I AM getting a pointer ?!?!

  • Thread starter Thread starter Paul Overway
  • Start date Start date
running access 2k

when my code gets compiled, access complains "user-defined type not
defined" and points to the following line of code:

Dim dbCurr As Database, dbLink As Database

I am at a complete loss as to why access thinks that "database" is a
user defined type????

ne ideas?

tia - Bob
 
Almost certainly, it is because the Reference to the DAO library is no
longer set by default in Access 2000 and 2002. Open any module in design
view, on the menu, Tools | References, check DAO 3.6 Library, and then for
each DAO object in your database, qualify the reference, as:

Dim rsABC as DAO.Recordset

If you don't also use ADO, then as a safety measure, you might want to move
the DAO Reference above the ADO Reference in the list of References.

Larry Linson
Microsoft Access MVP
 
thanks to both Paul & Larry;

the problem was easily rectified - I forgot about that little detail !
:)

tx again - Bob
 
Hi Paul

For some reason the "References" command under the Tools
menu is grayed out for me. How do I create a reference to
DAO?
I've posted my code FYI

Hafeez Esmail

Dim dbs As DAO.Database
Dim rstrec As DAO.Recordset
Dim rstname As DAO.Recordset
Dim strLastName As String

Set dbs = CurrentDb()
Set rstname = dbs.OpenRecordset("TblFHStaffList")
Set rstrec = dbs.OpenRecordset("QryPredef120")
If rstname.BOF = False And rstname.EOF = False Then
rstname.MoveFirst
Do While rstname.EOF = False
Set strLastName = rstname!Last_Name
If rstrec.BOF = False And rstrec.EOF = False Then
rstrec.MoveFirst
Do While rstrec.EOF = False
Where rstrec!Last_Name = strLastName
rstrec.MoveNext
Loop
DoCmd.Save acReport, "RptPredef" & strLastName
End If
rst.MoveNext
Loop
rstname.Close
Set rstname = Nothing
rstrec.Close
Set rstrec = Nothing
dbs.Close
Set dbs = Nothing
 
Access version 2002, file is version 2000. The problem
was that I wasn't in design mode.

Now that that's been taken care of, I'm getting an error
in the following line...

DoCmd.Save acDefault, "Predef120" & strLastName

Is there a way I can save the results as a report (or
table) with a different name?

Thanks
Hafeez Esmail


Dim dbs As DAO.Database
Dim rstrec As DAO.Recordset
Dim rstname As DAO.Recordset
Dim strLastName As String

Set dbs = CurrentDb()
Set rstname = dbs.OpenRecordset("TblFHStaffList")
Set rstrec = dbs.OpenRecordset("TblPredef120",
dbOpenSnapshot)
If rstname.BOF = False And rstname.EOF = False Then
rstname.MoveFirst
Do While rstname.EOF = False
strLastName = rstname!Last_Name
If rstrec.BOF = False And rstrec.EOF = False Then
rstrec.MoveFirst
Do While rstrec.EOF = False And rstrec!
Last_Name = strLastName
rstrec.MoveNext
Loop
DoCmd.Save acDefault, "Predef120" & strLastName
End If
rst.MoveNext
Loop
End If
rstname.Close
Set rstname = Nothing
rstrec.Close
Set rstrec = Nothing
dbs.Close
Set dbs = Nothing
 
Back
Top