D
dan dungan
Hi,
Using Access 2000 and windows xp, I'm using the following procedure to
import text files to access:
___________________________________________________
Private Sub ImportAll()
Dim strFile As String
Const conFolder As String = "K:\Customer Service\Quote\"
strFile = Dir(conFolder & "*.txt")
Do While strFile <> ""
DoCmd.TransferText acImportDelim, "Data Import Specification",
"tblData", _
conFolder & strFile
Kill conFolder & strFile
strFile = Dir
Loop
End Sub
____________________________________________________
To create a backup, I'm manually renaming the files NBdata.txt and
MBdata.txt to NBdataMMDDYY.txt and MBdataMMDDYY.txt. Then, I copy them
to the backup folder.
I need to automate these tasks.
I found the function FileCopy SourceFile, DestinationFile
Do I need to put this inside the loop? If so, I don't know the proper
sytnax to create a unique file name if a file has already been created
the same day. (The users may run the process more often than once a
day.
I appreciate any advice.
Thanks,
Dan Dungan
Using Access 2000 and windows xp, I'm using the following procedure to
import text files to access:
___________________________________________________
Private Sub ImportAll()
Dim strFile As String
Const conFolder As String = "K:\Customer Service\Quote\"
strFile = Dir(conFolder & "*.txt")
Do While strFile <> ""
DoCmd.TransferText acImportDelim, "Data Import Specification",
"tblData", _
conFolder & strFile
Kill conFolder & strFile
strFile = Dir
Loop
End Sub
____________________________________________________
To create a backup, I'm manually renaming the files NBdata.txt and
MBdata.txt to NBdataMMDDYY.txt and MBdataMMDDYY.txt. Then, I copy them
to the backup folder.
I need to automate these tasks.
I found the function FileCopy SourceFile, DestinationFile
Do I need to put this inside the loop? If so, I don't know the proper
sytnax to create a unique file name if a file has already been created
the same day. (The users may run the process more often than once a
day.
I appreciate any advice.
Thanks,
Dan Dungan