TransferDatabase passing variables

Giganews Newsgroups
Subject: TransferDatabase passing variables
Posted by:  acdevte…@gmail.com
Date: 24 Aug 2006

Hi,
I have a question about TransferDatabase. I am using the following
code, that works great:

    strDBFPath = "\servername\folder"
    strDBFFile = "Master"

DoCmd.TransferDatabase acImport, "dBase IV", strDBFPath, acTable,
strDBFFile, "tblMfgImport", False

However, I would like to append today's date to strDBFFile variable,
since that is how the files are saved on the server. So I changed
strDBFFile to the following variations:

    strDBFFile = "Master" & Format(Now(), "mmddyyyy")
    strDBFFile = "Master" & CStr(Format(Now(), "mmddyyyy"))

Using the immediate window, I can see these return the correct
filename, but then it gives me a run-time error 3011, indicating that
it cannot find the file specified.
When I click on Debug, and mouseover strDBFFile, the file name shows as
what it should be.

Why cant it find the file? Any ideas?

Thanks,
Puneet.

Replies