I have written some VBA code to import a file with a click of a button from a CD. The file is not always the same name but always follows the following:
D:\????f3??.vp
Here is the code.
DoCmd.TransferText acImportDelim, "550 Invoice Records Import Specification", "Tab 550 Current Month", Dir("D:\????f3??.vp"
, False, ""
The problem with this is that it cannot find the specified wildcard path unless i manually use the Get External Data function, select my import Spec, cancel it and then run the above code.
Likewise if i replace Dir("D:\????f3??.vp)" with the actual file location, ie D:\2170f323.vp, it also works. Any ideas what i have missed.
Cheers
Arry
D:\????f3??.vp
Here is the code.
DoCmd.TransferText acImportDelim, "550 Invoice Records Import Specification", "Tab 550 Current Month", Dir("D:\????f3??.vp"
The problem with this is that it cannot find the specified wildcard path unless i manually use the Get External Data function, select my import Spec, cancel it and then run the above code.
Likewise if i replace Dir("D:\????f3??.vp)" with the actual file location, ie D:\2170f323.vp, it also works. Any ideas what i have missed.
Cheers
Arry