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

Help linking key from form onto new form with sub

Status
Not open for further replies.

maxxev

Technical User
Jul 17, 2008
139
NL
Hi, I need help please, took a 2 month break for other projects and have forgotten how I did this before :(

Form 1
2x sub forms
Both subforms call forms with sub forms
One is working (sub form on called form has correct key), one is not (sub form on called form is independant).

Form 1:
"frmRMIngDeclaration"

Linked Sub form 2 on form 1
"S_frmSubComponents_in_Components"

Button on sub form in form 1
Code:
Private Sub Command15_Click()
On Error GoTo Err_Command15_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frmSubComp_COO"
    
    stLinkCriteria = "[SubComp_in_ingID]=" & Me![SubComp_in_ingID]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command15_Click:
    Exit Sub

Err_Command15_Click:
    If StandardErrors(Err) = False Then
    MsgBox Err & ": " & Err.Description
    End If
    'MsgBox Err.Description
    Resume Exit_Command15_Click
    
End Sub


Last form (form 2)
"frmSubComp_COO"
Has text box "SubComp_in_ingID" which pulls through from the master form fine.

However the subform on this form:
"S_frmIngDecSubComp_COO"
has no link to the "SubComp_in_ingID" and I can't remember how to make it have one, i've looked at everything I can think of in the working form, however I can't see how i've done it....

As you may have guessed i'm no programmer so please give clear answers.

Thank you
 
I don't understand the issues ... but a subform will have properties "Master" and "Child Link," and that is the designed way to make the subform reflect the main form. Would that apply?

[purple]If we knew what it was we were doing, it would not be called
research [blue]database development[/blue], would it? [tab]-- Albert Einstein[/purple]​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top