Results 1 to 10 of 10
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    LinkMasterFields (A2K)

    I have an unbound form that is opened via another form using OpenArgs. There are 5 choices from the OpenArgs. Depending on the OpenArg, the recordsource is assigned to the the unbound form.

    I have a NOTES form that I want to use as a subform. This however, requires the MASTER and CHILD links. How can I set the MASTER and CHILD in the OpenArgs to an unbound form?
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: LinkMasterFields (A2K)

    Will the Link Master Fields and Link Child Fields properties be the same for all choices? If so, try the following:
    - Open the main form in design view.
    - Temporarily set the Record Source property to one of the possible valid record sources,
    - Set the Link Master Fields and Link Child Fields properties of the subform.
    - Clear the Record Source property of the main form.
    - Save and close the main form.

    Or do you need to change the field names depending on the OpenArgs?

  3. #3
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: LinkMasterFields (A2K)

    The MASTER and CHILD will be the same no matter what is selected from the OpenArgs.

    I will give you suggestion a try and let you know the outcome.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  4. #4
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: LinkMasterFields (A2K)

    Just tried your suggestion. It worked as long as the form was bound. Once Unbound, I recieved the "Enter Parameter Value" requesting "pkProjectNumID". However, it will return the correct records for both the Main and Sub.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: LinkMasterFields (A2K)

    Which event do you use to set the Record Source?

  6. #6
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: LinkMasterFields (A2K)

    From a form in an AfterUpdate event each of the 5 controls, I have

    1. DoCmd.OpenForm FormName:="frm_IssueReview", OpenArgs:="LOB"
    or
    2. DoCmd.OpenForm FormName:="frm_IssueReview", OpenArgs:="Status"
    or
    3. DoCmd.OpenForm FormName:="frm_IssueReview", OpenArgs:="Issue"
    etc.

    Then In the OnLoad event of the unbound form I have:
    If OpenArgs = "LOB" Then
    Me.RecordSource = "qry_IssueReview_By_LOB"
    End If

    If OpenArgs = "Issue" Then
    Me.RecordSource = "qry_IssueReview_By_IssueType"
    End If


    If OpenArgs = "Status" Then
    Me.RecordSource = "qry_IssueReview_By_Status"
    End If
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: LinkMasterFields (A2K)

    Try using the On Open event of the unbound form instead of the On Load event.

  8. #8
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: LinkMasterFields (A2K)

    Did that already....no luck either.

    I find it odd that it will ask for the parameter value yet return the correct recordset and and link both MASTER and CHILD w/o a response from me.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: LinkMasterFields (A2K)

    OK, then you'll have to leave the Link Master Fields and Link Child Fields properties blank in design view, and set them in the On Open or On Load event AFTER setting the record source of the form:

    Me.SubformName.LinkMasterFields = "SomeField"
    Me.SubformName.LinkChildFields = "SameOrOtherField"

  10. #10
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: LinkMasterFields (A2K)

    That did it.......O....Thank you Hans
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

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