• Form construction (2000)

    Author
    Topic
    #460671

    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.

    Viewing 1 reply thread
    Author
    Replies
    • #1165767

      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?

      • #1165770

        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?

        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

    • #1165771

      Guys, I apologise for wasting time here, I hadn’t named my linking field correctly, I am so so sorry.

      Thanks, Darren.

    Viewing 1 reply thread
    Reply To: Form construction (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: