G
Guest
Access 2003 and a VB Module
I am trying to refer to a field name in a recordset (i.e. rst!fieldname =
"some text") for the purpose of writing data to that field(s) for a newley
created record in a table. The wrinkle to this is that I'm trying to variably
refer to a different field for each iteration of the loop that I'm running so
that the first loop will refer to
rst!.fieldname1, the second to rst!.fieldname2, etc.
I am using a variable to obtain the string value for fieldname1, fieldname2,
etc. in the process but when I use the code
rst!fieldname(i) = "some text"
I receive the message "object not found in collection" and the debug pane
shows that rst!fieldname(i) is set to nothing.
Any help is greatly appreciated.
I am trying to refer to a field name in a recordset (i.e. rst!fieldname =
"some text") for the purpose of writing data to that field(s) for a newley
created record in a table. The wrinkle to this is that I'm trying to variably
refer to a different field for each iteration of the loop that I'm running so
that the first loop will refer to
rst!.fieldname1, the second to rst!.fieldname2, etc.
I am using a variable to obtain the string value for fieldname1, fieldname2,
etc. in the process but when I use the code
rst!fieldname(i) = "some text"
I receive the message "object not found in collection" and the debug pane
shows that rst!fieldname(i) is set to nothing.
Any help is greatly appreciated.