Why am I getting this error?

Hi Experts,

I have the following VBA. The script works fine in Access 2003 but when I run it in Access 2007 I get a runtime error of 3845. Please see attached picture. How can I solve this problem?

Thanks
'**Establish link to table in 'load region'
        Set dbd = OpenDatabase(DestPathIs & "\" & strDatabase)
        For Each td In dbd.TableDefs
            If Left(td.Name, 4) <> "msys" And Left(td.Name, 1) <> "~" _
                And InStr(td.Name, "ImportErrors") = 0 Then
                DoCmd.TransferDatabase acLink, "Microsoft Access", DestPathIs & "\" & strDatabase, acTable, td.Name, td.Name
            End If
        Next

Open in new window

Error-3845.bmp
kosenrufuAsked:
Who is Participating?
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
is your Access 2007 application saved with extension .accdb ?

as the error message says, your current database  have a different format than the database (.mdb) you are trying to link with...
0
 
tbsgadiCommented:
Do you have both 2003 & 2007 installed on the same PC?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.