Within the VBA code, a database object is declared as follows:
Dim db As DatabaseWhen this code is encountered, Access highlights the line and I receive the following error message:
Compile error:I've seen this code work in other Access databases. How come it does not work in mine?
User-defined type not defined
Answer: This error often appears in Access 2000 version databases and higher. The error message looks like this:
To correct the problem, you need to open your Access database. Press Alt-F11 to open the Microsoft Visual Basic window. When the Microsoft Visual Basic window appears, select References under the Tools menu.
The References window should appear. Scroll down until you find the option called "Microsoft DAO 3.6 Object Library" and check this item. Then click on the OK button.
Now your Access database should recognize the database object and the error message should disappear. Source:techonthenet
No comments:
Post a Comment