Using a SQL statement to perform an update to a recordset, can you use the column/field position to set the value instead of the field name?
I've tried several variations, but can't seem to get it to work.
I believe you are correct, but I'm having difficulty structuring the SQL update statement.
I've tried:
Code:
strSQL = "UPDATE tblImport SET Fields(0) = 5 WHERE MemNum = 345;"
DoCmd.RunSQL(strSQL)
But that doesn't work. I also used .Fields(0), tblImport.Fields(0), Columns(0) and tblImport.Columns(0) and none of them work. I'm getting a syntax error in SQL statement.
Of course, when I replace the Fields(0) with the field name it works as expected.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.