Flash Drive Import

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
 
P

pietlinden

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
 
G

Guest

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top