Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello, I have a form with parent (say A), child (say B ), child of child say (C1), which works fine. I am now trying to modify with a second child of form B on the same form) Say (C2). I have dragged in a separate made form and linked the fields but it still isnít working correctly. When I click on a separate record in B, C1 correctly changes to show the linked records but form C2 displays the same data regardless of what parent record I am in on form B. I have my relations in order too.

    There is code underlying the child form B which is something is like this:

    Option Compare Database

    Sub Form_Current()

    Dim ParentDocName As String



    On Error Resume Next
    ParentDocName = Me.Parent.Name



    If Err <> 0 Then
    GoTo Form_Current_Exit
    Else
    On Error GoTo Form_Current_Err
    Me.Parent![frmJCheckSub].Requery

    End If

    Form_Current_Exit:
    Exit Sub

    Form_Current_Err:
    MsgBox Error$
    Resume Form_Current_Exit

    End Sub


    DO I need to modify this to include my new form C2?


    Your guidance is appreciated.


    Many thanks Darren.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    If you have specified the Link Child Fields and Link Master Fields properties correctly, both subforms should display the correct records automatically, without needing code.

    What is frmJCheckSub?

  3. #3
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='780963' date='22-Jun-2009 10:57']If you have specified the Link Child Fields and Link Master Fields properties correctly, both subforms should display the correct records automatically, without needing code.

    What is frmJCheckSub?[/quote]

    Thanks Hans, it is form C in my example. The code was added by the wizard which I built the form with? As another point which has just ocurred to me, the second sub (C1) when doen by the wizard is not within the detail part of the second form(. It is in form A's detail. I am attempting to add from C2 in A's detail too since I want B to be a recurring form which Access doesn't seem to allow within form B's detail. I hope this makes sense.


    Thanks

  4. #4
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Guys, I apologise for wasting time here, I hadn't named my linking field correctly, I am so so sorry.

    Thanks, Darren.

Posting Permissions

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