Hi to all
I have a text file which looks like the following
1,6345 1
2,0514 2
2,7129 2
5,8571 1
6,6885 1
7,7595 1
8,3747 2
9,2340 1
10,7079 2
11,3166 3
13,9199 2
14,1235 3
etc
345896606,655 343443
etc
As you can see The data are not very well alligned as the first column can grow and mess up the TransferText Action (I can't use fixed with As you can mention from the samples above.) when I try to Import the data into an Access Table
I've written the following piece of code in VBA but it does not Work (I can see that the comma(,) produces much of the error). the comma Is Used in the Text File as . but it cant be changed...
Dim A As DAO.Recordset
Dim Time As Double
Dim Custs As Long
Open "c:\scratch\results.txt" For Input As #1
Set A = CurrentDb!Table1.OpenRecordset
Do While Not EOF(1)
Input #1, Time, Custs
With A
.AddNew
!Time.Value = Time
!Custs.Value = Custs
.Update
End With
Loop
I'm missing something here but I'm not in the VB coding for long and I don't know what to do....
Help Please....
Nikos
I have a text file which looks like the following
1,6345 1
2,0514 2
2,7129 2
5,8571 1
6,6885 1
7,7595 1
8,3747 2
9,2340 1
10,7079 2
11,3166 3
13,9199 2
14,1235 3
etc
345896606,655 343443
etc
As you can see The data are not very well alligned as the first column can grow and mess up the TransferText Action (I can't use fixed with As you can mention from the samples above.) when I try to Import the data into an Access Table
I've written the following piece of code in VBA but it does not Work (I can see that the comma(,) produces much of the error). the comma Is Used in the Text File as . but it cant be changed...
Dim A As DAO.Recordset
Dim Time As Double
Dim Custs As Long
Open "c:\scratch\results.txt" For Input As #1
Set A = CurrentDb!Table1.OpenRecordset
Do While Not EOF(1)
Input #1, Time, Custs
With A
.AddNew
!Time.Value = Time
!Custs.Value = Custs
.Update
End With
Loop
I'm missing something here but I'm not in the VB coding for long and I don't know what to do....
Help Please....
Nikos