Change value in selected record of subform in code

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
 
V

Van T. Dinh

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top