Flash Drive Import

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

Guest

I am importing files with USB flash drives and need to designate which drive
the data is coming from. The VBA I am using does not work. Any help on this
would be greatly appreceated
Function IImsImport()
On Error GoTo IImsEmport_Err

Dim strDrive As String
strDrive = InputBox("Enter Drive for download", "")

DoCmd.TransferText acImportDelim, "ALID0001 Import Specification",
"ALID0001", "InputBox\ALID0001.TXT", True, ""
Beep
MsgBox "Down load Complete", vbOKOnly, ""


IImsEmport_Exit:
Exit Function

IImsEmport_Err:
MsgBox Error$
Resume IImsEmport_Exit
 
I am importing files with USB flash drives and need to designate which drive
the data is coming from. The VBA I am using does not work. Any help on this
would be greatly appreceated
Function IImsImport()
On Error GoTo IImsEmport_Err

Dim strDrive As String
strDrive = InputBox("Enter Drive for download", "")

DoCmd.TransferText acImportDelim, "ALID0001 Import Specification",
"ALID0001", "InputBox\ALID0001.TXT", True, ""
Beep
MsgBox "Down load Complete", vbOKOnly, ""

IImsEmport_Exit:
Exit Function

IImsEmport_Err:
MsgBox Error$
Resume IImsEmport_Exit

instead of
"InputBox\ALID0001.TXT"

you need the FULL path to the flash drive
G:\Folder\SubFolder\ALID0001.TXT

Using a hard coded path for a thumb drive is okay if you use the
database on a single computer, but if you have another with a
different configuration, it's going to bite you. (I wrote one of
those... had to fix someone's hard-coded crap.)

Pieter
 
I understand the hard coded path and that is my problem, is there any way to
get around it?
 
Back
Top