Results 1 to 5 of 5
  1. #1
    Robertt is offline Novice
    Windows 7 Access 2007
    Join Date
    May 2010
    Posts
    12

    need to have subform edit main form data without error

    I have a subform on a parent form's tab control, that has a bound checkbox to a child record. In the checkbox's onClick event, I need it to change two fields' values on the parent form (but on another tab). Coding the path to the objects hasn't been a problem except that no matter what I try, the moment I move out of the subform to the parent form, change records or save, I'm given the error "this record has been changed by another user... do you want to save, blah, blah, blah"

    I thought by linking the main form and the subform, this message was supposed to be eliminated, but it has been problematic at best. I know I can make all of my controls unbound, but that would be time consuming and create new problems.

    Someone here must have ran into this before and solved it simply. Does anyone have any suggestions that they have used before?

    Thanks,



    Robert

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    The "usual suspect" when you get that error is that you are trying to change values in code when a form or subform bound to the same table is open and dirty. The solution is typically to change them on the form instead of via recordset or SQL. How are you changing the values?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Robertt is offline Novice
    Windows 7 Access 2007
    Join Date
    May 2010
    Posts
    12
    Paul,

    Thanks for the reply. I'm changing the values via the forms, not the recordset. I.e. the code in the subform onClick event is...

    Code:
        Forms!frmPropertyDetails!Occupied.Value = Me.chkoccupied.Value
        Forms!frmPropertyDetails!propMargin.Value = valueB
    valueB is a variable.

    I've also verified that my mainform/subform's recordsets are using the other's recordsets accidentally through a join of some type.

    I've been fighting this for a couple of weeks and any help would greatly be appreciated.

    Thanks,

    Robert

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    I assume you mean they are not using each other's recordsets? Can you post the db?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Robertt is offline Novice
    Windows 7 Access 2007
    Join Date
    May 2010
    Posts
    12
    Paul,

    Yes, that is what I meant to say. Sorry for not being clear. Unfortunately, no I cannot publish the DB due to an NDA with the client.

    Robert

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 03-31-2010, 01:56 PM
  2. Subform won't display in main form
    By Lynn in forum Forms
    Replies: 15
    Last Post: 03-22-2010, 10:17 AM
  3. Linking Subform Control to Main form
    By KWarzala in forum Forms
    Replies: 1
    Last Post: 03-13-2010, 08:32 PM
  4. Replies: 1
    Last Post: 09-28-2009, 05:21 PM
  5. Subform vs main form calculation
    By fadone in forum Forms
    Replies: 17
    Last Post: 12-21-2005, 07:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums