Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform Link assistance

Status
Not open for further replies.

DblDogDare

Technical User
Feb 11, 2003
9
0
0
US
I am trying to link a form with 2 subforms. The parent form links fine with the 1st subform. The 1st subform is supposed to link to the 2nd subform. So, when a recordset is picked on subform 1, it shows the corresponding records in subform 2. What I am getting is all the records in subform 2, no matter which record in subform 1. I believe my problem is a child/Master link issue, or an event procedure that I should be using. Any assistance is greatly appreciated. I can provide a sample db if an email address is provided.
 
Thank you Zameer. I did use that very form as my example. However, I must be missing something simple. It usually ends up that way. I can scroll through the recordsets in subform 1, but the recordsets in subform 2 remain the same, which is the corresponding recordset of subform 1, recordset 1. I don't know if it should requery subform 2 when I select a different recordset in subform 1, and if so, I can't figure out where it is in the Northwind example. Thanks again for your assistance.
 
In the Module Customer Orders Subform1 you could see a code like below. You need to change the redbold to the second form's name. Then see how it works

Code:
Sub Form_Current()
' This code created by Form Wizard.
    Dim strParentDocName As String

    On Error Resume Next
    strParentDocName = Me.Parent.Name

    If Err <> 0 Then
        GoTo Form_Current_Exit
    Else
        On Error GoTo Form_Current_Err
        Me.Parent![[b][COLOR=red]Customer Orders Subform2[/color][/b]].Requery
    End If

Form_Current_Exit:
    Exit Sub

Form_Current_Err:
    MsgBox Err.Description
    Resume Form_Current_Exit

End Sub


Zameer Abdulla
Visit Me (New Look & style)
 
Zameer, That was exactly the problem. I suppose because I didn't use the link wizard, it did not create the requery for me. I assumed it was a requery that was missing. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top