Help...Error with Dim Statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have had some recent issues with database corruption. I tried to fix my
database using the Compact and Repair, but no avail, so then decided to just
create a whole new database, and then copy and paste all of the objects from
the old database to the new one. According to an article on the Microsoft
Knowledgebase, this seemed to be the way to go.

However, my problem is that Access no longer recognizes Set db as Database.

What have I done wrong?

If it matters, my old database was in Access 2000 format, and the new
database is in Access 2002/2003 format. I am using the same computer as
before, and actually using the same program (Access 2003). However, the old
database is about 5-6 years old and was created using Office XP. Since we're
now using Office 2003, I thought I'd "upgrade" to Office 2003.

Any suggestions anyone has would be extremely helpful!!!! Thanks in advance
to anyone who can reply.
 
brba said:
I have had some recent issues with database corruption. I tried to
fix my database using the Compact and Repair, but no avail, so then
decided to just create a whole new database, and then copy and paste
all of the objects from the old database to the new one. According
to an article on the Microsoft Knowledgebase, this seemed to be the
way to go.

However, my problem is that Access no longer recognizes Set db as
Database.

What have I done wrong?

If it matters, my old database was in Access 2000 format, and the new
database is in Access 2002/2003 format. I am using the same computer
as before, and actually using the same program (Access 2003).
However, the old database is about 5-6 years old and was created
using Office XP. Since we're now using Office 2003, I thought I'd
"upgrade" to Office 2003.

Any suggestions anyone has would be extremely helpful!!!! Thanks in
advance to anyone who can reply.

Go into the Tools -> References... dialog and make sure that (a) the
Microsoft DAO3.6 Object Library reference is present and still checked,
and (b) there are no references marked "MISSING".

Doug Steele has a good page on fixing reference problems:

http://www.accessmvp.com/djsteele/AccessReferenceErrors.html
 
I added the Microsoft DAO 3.6 Object Library and now I get an error that says
"Compile error: Method or data member not found" and the infamous debug
screen.

When I click debug, the highlighted line says:

.FindFirst "[EmployeeID]='" & Me![USERID] & "'"

with the USERID highlighted in yellow.

I double checked the Available References in my old database vs. this new
one and added everything I could so they are almost identical. The only
reference I could not add was the Microsoft Calendar Control 11.0 which is
not present in Access 2003 references for some reason.

Any suggestions?

Thanks again!
 
Do you have a control named USERID on your form? Is it bound to a field in
the underlying recordset named USERID? Try renaming the control (say, to
txtUserId), then change the reference in your code to point to the renamed
control (.FindFirst "[EmployeeID]='" & Me!txtUserId & "'")
 
Back
Top