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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dim mydb as database ----- "user defined type not defined" 1

Status
Not open for further replies.

vanti1

Technical User
Apr 11, 2001
6
IE
hi all,
i'm using a form with a subform with text boxes on the right i'm attempting to get user info from text boxes, hit add and it's copied to the subform.

looking at examples it says dim mydb as database
but this gives the error user defined type not defined. the keyword 'database' is not in any object group.

i'm using access 2000 anyone got any ideas?? thanks again in advance
 
Hi Vanti1!
Yes indeed. In VB menu bar Tools-References. You need a reference to Microsoft DAO 3.6 Object Library. Check it off and try to compile. No sucess? Open it again and move its priority up a notch or two. Bingo! :) Gord
ghubbell@total.net
 
As unhelpful as it can be if that did not work, I am not to good with dao stuff. Then I would definitely look at dim in help. Unfortunately 97 is much better with its help. But nevertheless. I would also recommend a good access dev reference. I have Access Developers Handbook 97. It is ok, a little basic, but I think that is just my bias. I want the book to have every piece of code and way it can be used in the book! Yep, I'm picky! Well, good luck, and never give up!
 
Access assumes that you are using ADO for recordsets. If you are actually using a DAO method then try the following:

Dim myDb As Database
Dim myRec As DAO.Recordset

Set myDb As CurrentDb()
Set myRec As CurrentDb.OpenRecordset(ENTER SQL STATEMENT HERE)

As indicated above, you will need to choose DAO 3.6 Object Library under Tools/References

Good Luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top