none
subform not retaining updated data RRS feed

  • Question

  • Hi folks-

    I've got a form, which includes a subform.  All fields in the parent form, including the subform itself, are 'locked' when the parent form opens.  There is a button which when clicked unlocks all fields, including the subform.

    Within the subform, I have a text field, and a drop combobox.

    With the fields all unlocked, if I change the data in the subform's text box, and then lock everything, the subform textbox retains what I typed in.
    However, with all unlocked, if I select a new option from the combo box in the subform, it holds until I lock everything.  At that point, it reverts to the original selection.

    Any suggestions as to what the issue is here?

    Wednesday, December 16, 2015 10:00 PM

Answers

  • It sounds like your problem is a failure to commit the changes to the record before you lock the record.  Once you lock the record, whatever changes you've attempted are lost.  You may still see the value(s) in the text or combo box simply because you haven't updated the display to reflect the actual record contents.
    Thursday, December 17, 2015 12:14 PM

All replies

  • Hi, Try stepping through your code to make sure you're not doing anything unexpected in there. Just a thought...
    Wednesday, December 16, 2015 10:40 PM
  • It sounds like your problem is a failure to commit the changes to the record before you lock the record.  Once you lock the record, whatever changes you've attempted are lost.  You may still see the value(s) in the text or combo box simply because you haven't updated the display to reflect the actual record contents.
    Thursday, December 17, 2015 12:14 PM
  • RunningManHD's explanation would be plausible if you were locking the 'record' in the true sense of term, but from your description, in which you refer to locking the 'fields' I'm guessing you are setting the Locked property of the bound controls.  This would not prevent the row in the table being updated.

    It would perhaps help if you could post the code of the subform's module.  At face value your description would suggest that not only is the Locked property of the controls being set to True but the controls are being undone.

    Ken Sheridan, Stafford, England

    Thursday, December 17, 2015 3:53 PM