PDA

View Full Version : VBA Data Types



john-86
03-02-2006, 05:51 AM
Hello all,
you may have to forgive me for asking a silly question, but I'm new to VBA programming. I've been developing a database, and having just completed a course in VB for Access I've started coding the forms. I've run into a pretty large problem. I cannot dimension a variable with database as the data type. I would use the standard:

Dim db As Database

This doesn't work. After hitting the space, Database isn't in the pop-up picklist. And when the code is run, it tells me it's a user defined data type... I thought it was standard. I need to be able to do this in order to program the database properly. Can anyone help me out?

Kind regards,
John

matthewspatrick
03-02-2006, 07:25 AM
I think Database is an object type in the DAO library. Check your references (under Tools in the VB Editor), and make sure you have a reference set to an appropriate version of the Microsoft Data Access Objects library.

Patrick

john-86
03-02-2006, 07:46 AM
Hi Patrick,
thank you very much for your help. It works fine now!

Kind regards,
John

:friends:

matthewspatrick
03-02-2006, 07:48 AM
You're most welcome :)