R
Ross
I want to pass field names to an SQL string to identify the current of many
fields that I have to update in the table tblData (ie Fields ----> Jan06,
Feb06, Mar03......Dec09).
I want to use a recordset with SQL to identify the current field and edit
and update the current record in the current field.
The field is identified in the SQL as followings:
tblData." & varFieldName & " where the variable might be set to "Jan".
<----------
This syntax works perfectly in the SQL to identify the current field in the
db.openreocrdset(strsql).
The update is NOT working :
..edit
!Jan = dblAmount <---------------This works
![" & varFieldname & "] = dblAmount <----------This does not work
..update
This error message "item not found in collection" implies that it is
looking for a field "Jan" in tblData but is unable to find "Jan" which does
exists. Highlighting the variable indicates that the variable is correctly
set to Jan.
How can I make this work using variables. My syntax must be wrong? I am
using a variant variable and had the same results with a string variable.
Thanks
Ross
fields that I have to update in the table tblData (ie Fields ----> Jan06,
Feb06, Mar03......Dec09).
I want to use a recordset with SQL to identify the current field and edit
and update the current record in the current field.
The field is identified in the SQL as followings:
tblData." & varFieldName & " where the variable might be set to "Jan".
<----------
This syntax works perfectly in the SQL to identify the current field in the
db.openreocrdset(strsql).
The update is NOT working :
..edit
!Jan = dblAmount <---------------This works
![" & varFieldname & "] = dblAmount <----------This does not work
..update
This error message "item not found in collection" implies that it is
looking for a field "Jan" in tblData but is unable to find "Jan" which does
exists. Highlighting the variable indicates that the variable is correctly
set to Jan.
How can I make this work using variables. My syntax must be wrong? I am
using a variant variable and had the same results with a string variable.
Thanks
Ross