Results 1 to 7 of 7
  1. #1
    5 Star Lounger
    Join Date
    Apr 2003
    Location
    Hampshire, United Kingdom
    Posts
    602
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Subform changes on save (Access 2002 (Office XP))

    <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15> <img src=/S/bwaaah.gif border=0 alt=bwaaah width=123 height=15> - yes, it's one of those, I'm afraid.

    I have a form with two distinct subforms in it, side by side, like so:
    <table border=1><td>Parent Form
    <table border=1>
    <td>Child1</td><td>Child2</td></table></td></table>

    Whenever I save the form, Access changes the SourceObject for Child2 to the same SourceObject as Child 1.
    In case I haven't been quite clear, <img src=/S/megashout.gif border=0 alt=megashout width=33 height=17> <big>It's infuriating!</big> <img src=/S/scream.gif border=0 alt=scream width=15 height=15> <img src=/S/bwaaah.gif border=0 alt=bwaaah width=123 height=15>

    Any ideas?
    Waggers
    If at first you do succeed, you&#39;ve probably missed something.

  2. #2
    5 Star Lounger
    Join Date
    Apr 2003
    Location
    Hampshire, United Kingdom
    Posts
    602
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform changes on save (Access 2002 (Office X

    In a bizarre twist, it seems to be working, in a way, now.
    My "parent form" is in fact a subform itself. When I open the "grandparent" form, Child2 displays correctly; yet when I open the "parent" form on its own, Child2 displays Child1's sourceobject.

    When I open "parent" in design view, it shows the correct sourceobject - if I then switch to form view and back to design view, it changes to the incorrect one!

    Very strange indeed, but as long as the correct object is shown in the "grandparent" form, I should be ok. I still don't like the inconsistency, though... <img src=/w3timages/censored.gif alt=censored border=0> Microsoft!
    Waggers
    If at first you do succeed, you&#39;ve probably missed something.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Subform changes on save (Access 2002 (Office XP))

    You didn't mention whether there is any code in the parent form that modifies or controls the source object in the subforms. In any case, it sounds like you might have some corruption or the Access engine has just managed to confuse itself. Have you tried decompling the project, then closing down and doing a compact and repair on reopening?
    Charlotte

  4. #4
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Subform changes on save (Access 2002 (Office X

    Dave

    I am making an assumption here, have you checked the Master/Child relationships in Child1 and Child2 and are they referencing the correct keys in the parent(master) form?

    Having checked that have you checked maste/child refrences to the Parent Grandparent form they some times conflict this is why I really try and stay clear of subforms in subforms <img src=/S/dizzy.gif border=0 alt=dizzy width=15 height=15>
    Jerry

  5. #5
    5 Star Lounger
    Join Date
    Apr 2003
    Location
    Hampshire, United Kingdom
    Posts
    602
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform changes on save (Access 2002 (Office X

    <hr>You didn't mention whether there is any code in the parent form that modifies or controls the source object in the subforms.<hr>
    There's no code in the parent form at all, although the grandparent form contains code that sets the parent's sourceobject. (There's no code that affects either Child form).

    Thanks for the decompiling advice - that's a new trick for me! Unfortunately, it didn't completely solve the problem. Everything works fine unless I switch from design view to form view. Opening directly in either view is ok, it's just the switch that seems to cause the problem. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

    At least it's something I can work around now. <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15>

    <img src=/w3timages/greenline.gif width=33% height=2>
    Update: The Child2 SourceObject is also changed AFTER I save the form - so whenever I save I also have to close the form and re-open it.
    Waggers
    If at first you do succeed, you&#39;ve probably missed something.

  6. #6
    5 Star Lounger
    Join Date
    Apr 2003
    Location
    Hampshire, United Kingdom
    Posts
    602
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform changes on save (Access 2002 (Office X

    Edited because I wrote "cascading" instead of "continuous" <img src=/S/stupidme.gif border=0 alt=stupidme width=30 height=30>

    Thanks Jezza - I've checked and double-checked, but the relationships are all ok and no change I'm afraid. But you're right - perhaps I'm being too ambitious. Both of my child forms are straightforward continuous forms, so could be replaced by listboxes instead.

    <img src=/S/whisper.gif border=0 alt=whisper width=29 height=17>By the way, your new sig is looking very smart indeed. I'm not normally a fan of the text-as-image idea, but there's always an exception. Help yourself to a [choccy bar].
    Waggers
    If at first you do succeed, you&#39;ve probably missed something.

  7. #7
    5 Star Lounger
    Join Date
    Apr 2003
    Location
    Hampshire, United Kingdom
    Posts
    602
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Solved...

    <img src=/S/doh.gif border=0 alt=doh width=15 height=15>I forgot to try the oldest trick in the book - creating a brand new .mdb file and importing everything from my existing database. It did the trick. <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>

    Sorry for the waste of time, I should have tried that much earlier!
    Waggers
    If at first you do succeed, you&#39;ve probably missed something.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •