Been searcing for a while, and cannot seem to find a case that is similiar enough to mine.
I want a string of code that allows me to import a series of delimited text files into access using VBA. I have the first bit of code down:
The text files hold data for a specific days work. Each day has its own text file. I would like to be able to import the text files within a specific date range, specified by the user. Below is the total code i have for my form button, any help would be greatly appreciated. I'm self taught, so be gentle
:
Cheers!
I want a string of code that allows me to import a series of delimited text files into access using VBA. I have the first bit of code down:
Code:
DoCmd.TransferText acImportDelim, deltxtimptbl, "Delivery(local)", "\\msfs3109\data1\share\everyone\prorep\tranhist\Delivery\" & currentdate & ".txt"
The text files hold data for a specific days work. Each day has its own text file. I would like to be able to import the text files within a specific date range, specified by the user. Below is the total code i have for my form button, any help would be greatly appreciated. I'm self taught, so be gentle

Code:
rivate Sub Command0_Click()
Dim startdate As String
Dim enddate As String
Dim currentdatex
Dim count As Integer
count = 0
startdate = Format(Me.Text1, "YYYYMMDD")
enddate = Format(Me.Text3, "YYYYMMDD")
currentdate = startdate
While currentdate <= enddate And count < 7
DoCmd.TransferText acImportDelim, deltxtimptbl, "Delivery(local)", "\\msfs3109\data1\share\everyone\prorep\tranhist\Delivery\" & currentdate & ".txt"
count = count + 1
currentdate = Format((Me.Text1 + count), "YYYYMMDD")
Wend
DoCmd.OpenTable "Delivery(local)", acViewNormal
End Sub
Cheers!