Run-time error 2507

Run-time error 2507

Post by U2Fza » Sat, 04 Apr 2009 04:41:01


I have a form where the user will key in a number associated with a directory
structure for many CDs that contain a database that I need to import the
data. I was going to have a TEMP table so that eventually this form will
drop all records in TEMP, transfer the data and then run an append query to
the main table. However, I keep getting the above error when I try to run
this code. Any ideas?

Dim stDBName, stSource, stDestination As String

stDBName = "E:\" & Me!ProjNum & "\PROJECT\DATA.mdb"
stSource = "DB1"
stDestination = "TEMP"

DoCmd.TransferDatabase , , stDBName, acTable, stSource, stDestination, False
 
 
 

Run-time error 2507

Post by U2Fza » Sun, 05 Apr 2009 00:49:02

After a day of struggling, I figured it out and can't believe it.

OLD
DoCmd.TransferDatabase , , stDBName, acTable, stSource, stDestination, False

NEW
DoCmd.TransferDatabase , "Microsoft Access", stDBName, acTable, stSource,
stDestination, False

Yup "Microsoft Access" was all that was missing. Hope this helps someone
else!