i have a TData table 4 input data from a log file. how can i filter it up n if the date 03/03/03 means year 2003, the data will be also stored on the T2003 table. N if data belongs to the year 2003 it will go to the T2002, and also the TData
this is the code that i used to enter data to TData table:
Private Sub Timer2_Timer()
Dim strTxtFiles As String
Dim strMdbFiles As String
Dim h As Integer
Dim odb As Database
Dim ors As Recordset
Dim count As Integer
Dim nextLine As String
Dim i, p, nextP As Long
On Error GoTo errorHandler
Set odb = OpenDatabase("C:\database\data.mdb"
Set ors = odb.OpenRecordset("Tdata"
h = FreeFile()
strtxtfile = "c:\temp\ex" & Format$(Now - 1, "YYMMDD"
& ".log"
txtFile.Text = strtxtfile
MsgBox strtxtfile
Open strtxtfile For Input As #h
For count = 1 To 4
Line Input #h, nextLine
Next
ors.AddNew
Do While Not EOF(h)
Line Input #h, nextLine
ors.AddNew
i = 0
p = 1
arrNextLine = Split(nextLine, " "
For intCtr = 0 To UBound(arrNextLine) '- 1
ors.Fields(intCtr).Value = arrNextLine(intCtr)
Next
ors.Update
Loop
Close (h)
Timer2.Enabled = False
main.mdisable.Enabled = False
main.Timer1.Enabled = False
Set ors = Nothing
Set odb = Nothing
insertLogFileForm.Visible = False
recordForm.Show
Exit Sub
errorHandler:
MsgBox Err.Description & vbCrLf & strtxtfile
Timer2.Enabled = False
End Sub
I'm Keep Studying.... please show the way...
Not Good in English
this is the code that i used to enter data to TData table:
Private Sub Timer2_Timer()
Dim strTxtFiles As String
Dim strMdbFiles As String
Dim h As Integer
Dim odb As Database
Dim ors As Recordset
Dim count As Integer
Dim nextLine As String
Dim i, p, nextP As Long
On Error GoTo errorHandler
Set odb = OpenDatabase("C:\database\data.mdb"
Set ors = odb.OpenRecordset("Tdata"
h = FreeFile()
strtxtfile = "c:\temp\ex" & Format$(Now - 1, "YYMMDD"
txtFile.Text = strtxtfile
MsgBox strtxtfile
Open strtxtfile For Input As #h
For count = 1 To 4
Line Input #h, nextLine
Next
ors.AddNew
Do While Not EOF(h)
Line Input #h, nextLine
ors.AddNew
i = 0
p = 1
arrNextLine = Split(nextLine, " "
For intCtr = 0 To UBound(arrNextLine) '- 1
ors.Fields(intCtr).Value = arrNextLine(intCtr)
Next
ors.Update
Loop
Close (h)
Timer2.Enabled = False
main.mdisable.Enabled = False
main.Timer1.Enabled = False
Set ors = Nothing
Set odb = Nothing
insertLogFileForm.Visible = False
recordForm.Show
Exit Sub
errorHandler:
MsgBox Err.Description & vbCrLf & strtxtfile
Timer2.Enabled = False
End Sub
I'm Keep Studying.... please show the way...
Not Good in English