• How to Embed a Subform in a Continuous Form

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » How to Embed a Subform in a Continuous Form

    Author
    Topic
    #461361

    Is it possible to embed a subform in a continuous form?
    The continuous form contains a list of books.
    Subform 1 is a list of categories assigned to the book.
    Subform 2 is a list of authors for the book.
    When record pointer moves from one book to another, the subforms update the categories and authors accordingly.
    Is it doable in Access 2007?
    Armstrong

    Viewing 0 reply threads
    Author
    Replies
    • #1170238

      You can’t place a subform in the detail section of a continuous form.

      You can place a subform in the form footer (or form header) of a continuous form, and link it to the main form as usual. As the user scrolls through the records of the continuous form, the subform will display the corresponding records.

      Another option is to place the continuous form and the “subforms” side by side in the detail section of an unbound main form. You’d have to link the “subforms” to a control on the continuous form, which can be a bit tricky, but it does work.

      • #1170242

        You can’t place a subform in the detail section of a continuous form.

        You can place a subform in the form footer (or form header) of a continuous form, and link it to the main form as usual. As the user scrolls through the records of the continuous form, the subform will display the corresponding records.

        Another option is to place the continuous form and the “subforms” side by side in the detail section of an unbound main form. You’d have to link the “subforms” to a control on the continuous form, which can be a bit tricky, but it does work.

        Hi Hans,
        Before reading your reply, I’ve already done the 1st approach you suggested. Yes, my subforms are placed in the header. I will take some time to try out your 2nd approach.
        The reason I raised the question is Access 2007 always issues warning whenever I insert subforms in the header/footer. In addition, Access changes the Default View from Continuous Forms to Single Form automatically. That led me to believe that Access may not support subforms being embedded in the continuous form.
        In fact, the Default View (property) can be manually changed back to Continuous Forms.
        Thanks for your help.
        Armstrong

        • #1170258

          Yes, Access changes the default view back to single form if you place a subform anywhere on a continuous form, but it the subform is placed in the form header or footer, you can easily change it back. You can’t do that if you place the subform in the detail section.
          This behavior has been the same in all versions of Access as far as I know.

          If you place subforms side by side, the Link Master Fields property of the second subform will look like FirstSubForm!RelevantControl where FirstSubForm is the name of the first subform as a control on the main form, and RelevantControl is the name of the control bound to the field that you want to link to.
          You can’t use the builder/wizard to set the Link Master Field property in this situation, you must set it manually.

      • #1170344

        Another option is to place the continuous form and the “subforms” side by side in the detail section of an unbound main form. You’d have to link the “subforms” to a control on the continuous form, which can be a bit tricky, but it does work.

        Though I’m contented with the header/footer placement (as shown in the screenshot), I’m obsessively intrigued by your side-by-side solution. Alas, forgive my ignorance. I have trouble to understand and implement it. In particular, I have trouble to understand the above quoted paragraph.

        Questions:
        1. Why does it mean by “to place the continuous form and the subforms side by side in the detail section of an unbound main form.
        2. By “unbound main form,” does it mean the main form isn’t bound to any dataset/recordset?
        3. Would you be exceedingly generous enough to create a sample database to help my troubled learning?

        3 tables
        Table A: BookID, BookTitle
        Table B: BookID, Category
        Table C: BookID, Author
        Both Table B & C are related to Table A by BookID.

        Thanks a lot.

        Armstrong

        Edited: 7/22/2009 Wed 09:47:10 AM HKT
        Q1 should read: What does it mean by “to place the continuous form and the subforms side by side in the detail section of an unbound main form”?
        Sorry for my typo.

        • #1170349

          Questions:
          1. Why does it mean by “to place the continuous form and the subforms side by side in the detail section of an unbound main form.
          2. By “unbound main form,” does it mean the main form isn’t bound to any dataset/recordset?
          3. Would you be exceedingly generous enough to create a sample database to help my troubled learning?

          Q2: Yes. In 2007 Create …Form Design does this for you.
          Q1: to put things side by side, you need a container to hold them. An unbound form does that job.
          But I often do this where the Main container form is not unbound. In the screenshot below, the main form is about Medical Practices. For each practice I want to have multiple communication records, but each of these is about multiple doctors. So in this case I have used the side-by-side solution.

          I am always concerned when I do this that people will attach records (at the side) to the wrong master record. So in this case I use the pink/red rectangle to reinforce the current record, and I also display Date/time of the current call is also display at the top of the form on the right.

          Q3. I haven’t time at the moment. Can you post your books database? Someone could add a side by side example to that, without having to start again.

          • #1170350

            Hi John,
            Thanks for your extensive reply. I’m amazed by your sophisticated UI design.
            Armstrong

          • #1171301

            How could one form contain two forms side-by-side like yours?
            Armstrong

            • #1171302

              Open the main form in design view.
              Arrange the database window and the form window so that you can see both.

              Drag a form from the database window and drop it onto the main form to add it as a subform.
              Move the subform to the position where you want it.
              Repeat the above steps for the other subform.

            • #1171304

              Open the main form in design view.
              Arrange the database window and the form window so that you can see both.

              Drag a form from the database window and drop it onto the main form to add it as a subform.
              Move the subform to the position where you want it.
              Repeat the above steps for the other subform.

              Wow, it’s that simple. It works brilliantly. Thanks for your rapid rescue. It took me a week struggling for the solution in vain.
              Armstrong

    Viewing 0 reply threads
    Reply To: How to Embed a Subform in a Continuous Form

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: