Switchboard 97>2000

V

Valerie

I have created a database based on a 97 template, but have
converted it to 2000. My problem is the switchboard. When
I try to open it, I get a VB error: "Compile error: User
defined type not defined" and it highlights two lines of
code: "Private Sub Form_Open(Cancel As Integer)" and
Dim "dbs As Database".

I haven't a clue what either of these things means nor how
to fix them. Any help would be most appreciated. My
database is otherwise finished and ready for my coworkers
to use, but we need to clear this one hurdle before I can
call it complete.

Thanks in advance.

Val
 
D

Douglas J. Steele

Not sure why you're getting the first error, but the second one is because
database is a DAO object, and by default, Access 2000 uses ADO.

With any code module open, select Tools | References from the menu bar,
scroll through the list of available references until you find the one for
Microsoft DAO 3.6 Object Library, and select it. If you're not going to be
using ADO, uncheck the reference to Microsoft ActiveX Data Objects 2.1
Library

If you have both references, you'll find that you'll need to "disambiguate"
certain declarations, because objects with the same names exist in the 2
models. For example, to ensure that you get a DAO recordset, you'll need to
use Dim rsCurr as DAO.Recordset (to guarantee an ADO recordset, you'd use
Dim rsCurr As ADODB.Recordset)

The list of objects with the same names in the 2 models is Connection,
Error, Errors, Field, Fields, Parameter, Parameters, Property, Properties
and Recordset

It's entirely possible that correcting that error will fix the other one as
well.
 
V

Valerie

I checked the DAO 3.6 Object Library and unchecked the
ActiveX Data Objects 2.1 Libary, but from that point
forward in your reply, I'm totally lost. (Sorry, but I am
brand new to this.) I don't have a clue what steps I am
supposed to take to "disambguate" the declarations as you
suggest.

When I made those two changes to the properties, I got a
new message in trying to view the switchboard in form
view. This time it was "Run-time error '438' Object
doesn't support this property or method." Is that because
I have not changed the declarations as you suggested, or
is something else causing this?

I get a similar message when I try to open one of my
forms, although in that instance it will go ahead and open
and then function properly.

Sorry to be such an idiot, and thanks for your help.

Val
 
G

GVaught

After you made the change you need to Compile the database. Return to the
Code editor window where you made the reference change and select Debug |
Compile. This will alert you to any code that may not have converted over
during the upgrade or any other missing references.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top