I have a variable that must determine what field must be populated in a table. Is this possible?
Code:
Sub Get_Variable_Field_Name()
dim db as database
dim rst as recordset
set db = Currentdb
set rst = OpenRecordset("MyRecordSet")
VarFieldName = "Valid table field name goes here"
rst.addnew
rst!("How do I reference the varable as a field name") = "MyFieldValue"
rst.update
rst.close
db.close
set rst = nothing
set db = nothing
end sub