Hi all,
I have a table in Access 2016 with an array of fields, example Field1, Field2, Field3, etc.
I need to update these fields with data from a form. The data is stored in an Array (FieldArray(5)). Each Field in the table needs to be updated with the corresponding data in the Array "FieldArray").
I know one can use "rst.Fields("Field" & i), but it does not work for me as I am not retrieving any dta, I only want to update.
So I was thinking in the line of the following code:
for i = 1 to 5
SQL = UPDATE Tbl_MyTable SET Fields("Field" & i) = " & FieldArray(i) & " WHERE IDNumber = " & MyID & ";"
docmd.runsql sql
Next i
But the above does not work.
Any suggestions will be appreciated.
Thanks
I have a table in Access 2016 with an array of fields, example Field1, Field2, Field3, etc.
I need to update these fields with data from a form. The data is stored in an Array (FieldArray(5)). Each Field in the table needs to be updated with the corresponding data in the Array "FieldArray").
I know one can use "rst.Fields("Field" & i), but it does not work for me as I am not retrieving any dta, I only want to update.
So I was thinking in the line of the following code:
for i = 1 to 5
SQL = UPDATE Tbl_MyTable SET Fields("Field" & i) = " & FieldArray(i) & " WHERE IDNumber = " & MyID & ";"
docmd.runsql sql
Next i
But the above does not work.
Any suggestions will be appreciated.
Thanks