Apologies if this is obvious, but I've been struggling to figure out how to do it...
I have a form and a VBA event in which I would like to update a field in the current record. However, the field name is stored as a variable so I can't just use Me!FieldName = __
I've tried simply the following, but get a "No current record" error. I appreciate why I'm getting the error, but how do I select the record currently visible in the form to edit?
I have a form and a VBA event in which I would like to update a field in the current record. However, the field name is stored as a variable so I can't just use Me!FieldName = __
I've tried simply the following, but get a "No current record" error. I appreciate why I'm getting the error, but how do I select the record currently visible in the form to edit?
Code:
foo = "bar"
Me.Recordset.Edit.Fields(foo) = True