Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting error message for "Dim CurDB As Database"

Status
Not open for further replies.
Jan 14, 2002
143
US
Does anybody know why I get an error message saying "user-defined type not defined" for:

Dim CurDB As Database


Isn't "database" a pre-defined type and therefore suppose to be blue and also not to be giving me this stinking message? Well its black and it is giving me this message. WHY???

help!


 
In the vba code window
Tools|References
select Microsoft DAO x.x
JHall
 
thank you very much.

...now i'm getting a "type mismatch" message for

Set dbs = CurrentDb

 
Always declare your objects as their type. For example
Dim theDB as DAO.database
Set theDB= DBEngine(0)(0)

This will increase performance and ensure that you will catch any inappropriate method invocations or propert operations on your object. Early Binding vs. Late Binding JHall
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top