Consulting

Results 1 to 4 of 4

Thread: Open a Subform Based on the Current Record

  1. #1
    VBAX Newbie
    Joined
    Feb 2019
    Posts
    5
    Location

    Open a Subform Based on the Current Record

    Users navigate through my database with a navigation form. I want to have a button that opens a different subform based on the current record. I can get the main version of the form to open with the OpenForm command like so
    DoCmd.OpenForm "FormName", , ,"RecordID = " & Me.RecordID
    However, I can only get this to open the main form. I can't seem to figure out the syntax to have Access open the form as part of the navigation form. The only solutions I've been able to find don't relate to navigation subforms.

    Thanks in advance for any help or advice!

  2. #2
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,141
    Location
    The subform should be on the mainform and use Master/Child Links to display the same record.

  3. #3
    Re >>>The only solutions I've been able to find don't relate to navigation subforms<<<


    I have no experience with navigation forms because I was always advised never to use them! I think this is what you have discovered, they don't work well with Code. Could you change over to the normal Subform/Subreport Control arrangement?

  4. #4
    VBAX Newbie
    Joined
    Feb 2019
    Posts
    5
    Location
    Looks like that will be the only option. Thanks for the assistance!

Tags for this Thread

Posting Permissions

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