Change value in selected record of subform in code

  • Thread starter Thread starter Max Moor
  • Start date Start date
M

Max Moor

Hi All,
I want to change the value of a field in the selected record of a
subform. I used code like:


Me!fsub_MySubform.Form.Recordset.Fields(7) = 100


It gived me the runtime error "Update or CancelUpdate without AddNew
or Edit."

The record exists, and the subform allows edits. I couldn't find
help on the "Edit" property, and the EditMode property seems to be just a
readable thing. Can someone tell me the proper syntax to set Edit?

- Max
 
If you meant the CurrentRecord on the SubForm then you
don't need the Recordset at all. Simply use:

Me.SubformCtrl.Form!BoundControl = 100

HTH
Van T. Dinh
MVP (Access)
 
Back
Top