none
Form w/ subform changing unselected data RRS feed

  • Question

  • I have a form with a subform embedded in it. The form and subform are linked using the attribute called "GroupID". The form allows the user to choose a GroupID from a list box and all the individual records for that group appear in the subform. For some reason, whenever data is updated in the subform, the GroupID for a record in a different group (not the one displayed) is changed.

    For example, if the GroupID's are A, B, C, D, when GroupID A is selected and data in the subform is updated, then a record from Group B has its GroupID changed to Group D.

    This change is reflected both in the form and in the underlying table. The form and underlying tables have no default values set for the involved attributes and there are no events programmed for the involved attributes. 





    • Edited by bb1028 Wednesday, January 4, 2017 7:56 PM
    Wednesday, January 4, 2017 7:54 PM

All replies

  • This may be a case where we'll have to see it in action to figure out what's going on.

    Just a thought...

    Wednesday, January 4, 2017 8:17 PM
  • That's odd, all right.  The first thing to make sure of is that the GroupID control on the *main* form is unbound.  Although it wouldn't explain exactly the sequence of events you describe, if the main form is bound and the GroupID control on that form is bound to the GroupID field, then the act of selecting a GroupID in that control would change the value of the GroupID field in the main form's record.

    If it's not a bound control, then my guess is that there is some code or macro that is misbehaving.


    Dirk Goldgar, MS Access MVP
    Access tips: www.datagnostics.com/tips.html

    Wednesday, January 4, 2017 8:35 PM
  • I just changed the list box to be unbound and it seems to be working fine now. Still can't quite figure out how/why it was changing random records, but it appears fixed. Thanks!
    Wednesday, January 4, 2017 8:38 PM
  • I just changed the list box to be unbound and it seems to be working fine now. Still can't quite figure out how/why it was changing random records, but it appears fixed. Thanks!

    If the list box was bound, that means the main form itself was bound, and the value selected in the list box would be mirrored in whatever record was current on the main form -- initially it would show as selected whatever GroupID was set in that record, and selecting a different GroupID in the list would change the GroupID in that record.

    Is your main form bound to the same table as the subform?  If so, probably it should be unbound.  From your description, it seems that maybe the main form exists only to allow the selection of the GroupID for the records to be shown on the subform.  If that's the case, then the form ought to be unbound.


    Dirk Goldgar, MS Access MVP
    Access tips: www.datagnostics.com/tips.html

    Wednesday, January 4, 2017 8:46 PM
  • Hi bb1028,

    From your last reply it looks like your issue is solved now.

    so I suggest you to mark the suggestion as an answer which helped you to solve the issue.

    it will help us to close this thread.

    if you do not take mark action then this thread will remain open forever.

    so please take the mark action as soon as possible.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, January 5, 2017 2:58 AM
    Moderator