Compile errors (Vis basic)

H

Hammond-Wandsworth

Hi,

I've been working on constructing a fairly complex database for some time
now and have run into a serious problem. With the database otherwise complete
I find that if another user on my network tries to access particular forms
from the title menu form an error box appears - Compile Error: Can't find
project or library' and in the background Visual Basic pops up. Highlighted
amongst the code is a section that looks like this:

Private Sub Form_Open (Cancel As Integer)
Dim Hold As Varient
Dim tmpKey As Long
Dim I As Integer
Dim rs As DAO.Recordset
Dim db As DAO.Database

Now my undertanding of VB is limited so this has lost me. My IT department
suggested it maybe something to do with people having different versions of
Access, however this happens whether the user has Access 97, 2000 or any
later version. The database was built using Access 2000. This presents a
problem as the database needs to be accessed by several users across the
network. This has got me very stuck - I hope somone can help.
 
K

Klatuu

This is probably a reference problem. Since you are referencing DAO, I
suspect you are missing a reference to the DAO library on the offending
machine. To check references, go to the machine where the error occurs, open
the VBA editor and select Tools, References and look for any that are marked
"Missing".

I don't remember which versions of Access using which, but I do know that at
some point, the default went from DAO to ADO, and now DAO is back as the
default (2003, I think).
It is also important to note that different version of Windows and different
versions of Office require different references.

Here is a site that you may find useful:

http://allenbrowne.com/ser-38.html
 
D

Duane Hookom

Try change the spelling of Variant

Private Sub Form_Open (Cancel As Integer)
Dim Hold As Variant
Dim tmpKey As Long
Dim I As Integer
Dim rs As DAO.Recordset
Dim db As DAO.Database
 

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