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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking a subform to a subform 2

Status
Not open for further replies.

lck092580

Programmer
Jun 19, 2002
440
CA
Hi,

I was wondering if it's possible to link a subform to a subform that's in a main form.

Basically what I have is a main form on one tab. Then another subform that's linked to the main form on the second tab. I want to put another subform in there but the wizard forces me to link it with the main form and not the subform in the second tab. Anyone know how I can accomplish this? Thanks.
 
How are ya lck092580 . . .

Perhaps faq702-5860 will help! . . .

Calvin.gif
See Ya! . . . . . .
 
or...
To link Subform2 To Subform1 in a Mainform, in Subform2 you put:
Link Master Field Property: [Subform1].Form![OrderID]
Link Child Field: [OrderID]
Note: refer directly to the subform without refering the mainform first!

'to synchronize Subform2 with Subform1, Put in Subform1 in the On Current Event:

Code:
Private Sub Form_Current()

 'Sync Subform2 with Subform1
    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![Subform2].Requery
    End If

Form_Current_Exit:
    Exit Sub

Form_Current_Err:
    MsgBox Err.Description
   Resume Form_Current_Exit
End Sub

Pampers [afro]
Keeping it simple can be complicated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top