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!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
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:
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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?
 
Upvote 0
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:
Upvote 0

Forum statistics

Threads
1,213,521
Messages
6,114,104
Members
448,548
Latest member
harryls

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top