G
Guest
Normally I would adress fields in a recordset by their name - like:
Set rst = dbs.OpenRecordset(sql)
With rst
.AddNew
!FN1 = val1
.Update
End With
Now I have a table with the fields FN1, FN2, FN3,... FN25
Is there a way to adress these fields with a counter - i.e. build up the
name from the string "FN" & i where i is the counter?
I would then have a loop:
for i = 1 to max
!("FN" & i) = val(i)
next i
This doesn't wotk - but I believe there is a way to do it - possibly using
the .fields! syntax - but I have just not managed to do it.
Set rst = dbs.OpenRecordset(sql)
With rst
.AddNew
!FN1 = val1
.Update
End With
Now I have a table with the fields FN1, FN2, FN3,... FN25
Is there a way to adress these fields with a counter - i.e. build up the
name from the string "FN" & i where i is the counter?
I would then have a loop:
for i = 1 to max
!("FN" & i) = val(i)
next i
This doesn't wotk - but I believe there is a way to do it - possibly using
the .fields! syntax - but I have just not managed to do it.