Show all records of Main form in the subform instead of just one
Results 1 to 7 of 7

Thread: Show all records of Main form in the subform instead of just one
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Oct 2018
    Posts
    30
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Show all records of Main form in the subform instead of just one

    I have a main form named "frmTagEntry". The Subform is named "subTagEntry". I want to be able to view all of the records in the subform in datasheet view and have them linked with all of the records in the main form in formview. Basically mirror the form in split form view but using a subform instead. I have a button in the main form for adding a new record that works great but nothing is linked together.

    Please help!

  2. #2
    MrExcel MVP
    Moderator
    xenou's Avatar
    Join Date
    Mar 2007
    Location
    Clev. OH, USA
    Posts
    16,445
    Post Thanks / Like
    Mentioned
    11 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Show all records of Main form in the subform instead of just one

    For linking subforms with main forms you set up the relationships in the subform properties with keys (fields) from the parent (main form) and the child (subform). If you are adding records on the fly and not seeing them you might need to refresh the data for the form after adding new data to tables.

    But I'm not really sure at all what you really mean by having all records in the main form linked to all records in the subform. If every record in the main form is linked to every record in the subform, you can just display the subform without any linking -- i.e., because by definition they would all be linked to whatever record(s) is (are) current in the main form, and therefore they should all be displayed.
    Last edited by xenou; Jun 21st, 2019 at 05:07 PM.

    Using: Office 2010/Win7 (work) Office 2010/Win7 (home)

    You are rich in proportion to the number of things you can let alone.
    -- Henry David Thoreau

  3. #3
    New Member
    Join Date
    Oct 2018
    Posts
    30
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Show all records of Main form in the subform instead of just one

    I have it linked to TagID on the link Master Field and TagID on the child field. It only shows 1 record, I want it to show all records and if I click in a record in the main form in form view then I want it to select it below in the subform having the same behavior as split form view.

  4. #4
    Board Regular
    Join Date
    Jun 2015
    Location
    Ontario, Canada
    Posts
    1,676
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Show all records of Main form in the subform instead of just one

    I want to be able to view all of the records in the subform in datasheet view and have them linked with all of the records in the main form in formview.
    Technically I don't think this is possible. A subform view doesn't show "all the records". It only shows records that are related to the ONE record in the main form, and a main form doesn't show "all the records" either - it only shows the "one" one at a time. You navigate from "one" to another "one" and the "many" in the subform change to suit.

    Then there is the split form, which is meant to show 2 views of the same record - one as single record, the other as datasheet, but on the same form. Maybe what you are asking for is a main/sub form design that emulates a split form? If so there are a few links about it here

    https://access-programmers.co.uk/for...d.php?t=294421

    I know I've seen links in many other posts for a while now for this, but I've never followed any of them. One of the key constraints is that you do not link the main and sub as one would normally expect.
    Tips for posting problems:
    1) "doesn't work" doesn't help. Post error message text/numbers and/or state what's happening.
    2) if posting code or sql, use code tags; specify on which code line errors occur, if applicable
    3) try to be specific; assume we know nothing about your issue - because we don't!

    Make all suggested changes in copies of your database or to its objects.

    "1 out of 1010 people understand binary. The other 1001 don't."

  5. #5
    Board Regular
    Join Date
    May 2013
    Posts
    628
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Show all records of Main form in the subform instead of just one

    I use that method that Micron has linked to, though I prefer to only edit in the main form.
    A few lines of code in the form load is all you need.

    What I like about this is that there are a few bugs with split form behaviour that this method does not have.
    Also you do not need to have same controls on each form.
    I use the datasheet view to select a record, then edit in the main form.
    Office 2007
    Access novice. Sometimes trying to give something back

  6. #6
    New Member
    Join Date
    Oct 2018
    Posts
    30
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Show all records of Main form in the subform instead of just one

    welshgasman: I got it to working except I cannot edit the records from the subform. The only thing I have on the main form is a cmd button to add a new record and a search cbo to search for a job number. Are there a way to make the subform edititable?

  7. #7
    Board Regular
    Join Date
    May 2013
    Posts
    628
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Show all records of Main form in the subform instead of just one

    Quote Originally Posted by bama4954 View Post
    welshgasman: I got it to working except I cannot edit the records from the subform. The only thing I have on the main form is a cmd button to add a new record and a search cbo to search for a job number. Are there a way to make the subform edititable?
    Yes, check out the whole thread from the link Micron posted.
    I have always left my subform as read only, in fact I have AllowEdits set to false and the controls locked, just in case.
    Download the DB and test it out.

    However from what you have now stated, you do not appear to be wanting a split form at all.?
    You could just have a search form.?

    Check out http://allenbrowne.com/ser-62.html

    He does have the controls locked as well, but if you unlock, you can edit.
    Last edited by welshgasman; Jun 24th, 2019 at 02:26 AM.
    Office 2007
    Access novice. Sometimes trying to give something back

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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