Dim db As Database
Dim set1 As DAO.Recordset
Set db = CurrentDb()
Set set1 = db.OpenRecordset("archives", dbOpenDynaset)
set1.FindFirst "[factory_ref]='" & [factory_ref] & "'"
set1.Edit
set1.[lock_ref] = Me![partcode]
set1.Update
set1.Close
the above works fine as written but what I would like to do is replace [lock_ref] with a value stored in a variable for example
dim s as string
s = me![lock_ref]
set1.s = Me![partcode]
thank you in anticipation
gezro
Dim set1 As DAO.Recordset
Set db = CurrentDb()
Set set1 = db.OpenRecordset("archives", dbOpenDynaset)
set1.FindFirst "[factory_ref]='" & [factory_ref] & "'"
set1.Edit
set1.[lock_ref] = Me![partcode]
set1.Update
set1.Close
the above works fine as written but what I would like to do is replace [lock_ref] with a value stored in a variable for example
dim s as string
s = me![lock_ref]
set1.s = Me![partcode]
thank you in anticipation
gezro