M
M Skabialka
Because of the complexities of an Excel spreadsheet that I need to import
into Access, I have decided to import the whole worksheet into Access then
use VBA to go through it row by row, field by field.
The spreadsheet will have to be imported each two weeks, and the data will
replace what is there. The number of columns increases weekly, the rows
sometimes.
Since I am bringing it into a new table, the test I have done creates field
names from F1 to F203. How do a use a loop to go through these fields? And
is there a limit to the number of fields in a table - like 254 or some other
power of 2? I am using Access 2003 for now, will use 2007 later.
do until recordset.EOF
for x = 1 to rs.fields.count
do something with rs!Fx 'how do I create this fieldname so it
will read as F1, F2, F3, etc?
next x
rs.movenext
loop
into Access, I have decided to import the whole worksheet into Access then
use VBA to go through it row by row, field by field.
The spreadsheet will have to be imported each two weeks, and the data will
replace what is there. The number of columns increases weekly, the rows
sometimes.
Since I am bringing it into a new table, the test I have done creates field
names from F1 to F203. How do a use a loop to go through these fields? And
is there a limit to the number of fields in a table - like 254 or some other
power of 2? I am using Access 2003 for now, will use 2007 later.
do until recordset.EOF
for x = 1 to rs.fields.count
do something with rs!Fx 'how do I create this fieldname so it
will read as F1, F2, F3, etc?
next x
rs.movenext
loop