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

bama4954

New Member
Joined
Oct 31, 2018
Messages
35
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!
 

Some videos you may like

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

xenou

MrExcel MVP, Moderator
Joined
Mar 2, 2007
Messages
16,673
Office Version
2013
Platform
Windows
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:

bama4954

New Member
Joined
Oct 31, 2018
Messages
35
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.
 

Micron

Well-known Member
Joined
Jun 3, 2015
Messages
1,853
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/forums/showthread.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.
 

welshgasman

Well-known Member
Joined
May 25, 2013
Messages
822
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.
 

bama4954

New Member
Joined
Oct 31, 2018
Messages
35
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?
 

welshgasman

Well-known Member
Joined
May 25, 2013
Messages
822
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:

Watch MrExcel Video

Forum statistics

Threads
1,102,478
Messages
5,487,115
Members
407,579
Latest member
chhantelravi

This Week's Hot Topics

Top