Solved Nested Forms (1 Viewer)

LALovelady

New member
Local time
Today, 16:11
Joined
Apr 6, 2021
Messages
17
I have a form with a subform which also has a subform. I want them all to be set to Continuous Form. I had it all working and then messed it up. Tried to recreate but can't get the main form (frmMeters) to show the records. It will show the records if I delete its subform (frmMetersSub).
 

Attachments

  • SEVDatabase.accdb
    3.3 MB · Views: 171

Pat Hartman

Super Moderator
Staff member
Local time
Today, 17:11
Joined
Feb 19, 2002
Messages
43,331
I have no idea what forms you are talking about. I don't see a form with nested subforms.

BTW, the only way to do this is to use subdatasheets and they leave a lot to be desired. There are other ways. I use two subforms side-by-side. the left form shows a list and when you click on a row, the right form syncs and shows the list that goes with the highlighted record. Here's a picture of a complex version.
ThreeSubForms2.JPG
ThreeSubforms.JPG
 

mike60smart

Registered User.
Local time
Today, 22:11
Joined
Aug 6, 2017
Messages
1,913
Your table structures were not correct because you were using Lookup Fields in your tables.

It is recommended that you use an Autonumber for each table, although some disagree.

I modified the tables so each has its own Autonumber Field.

I redesigned the Form that Opens so that you now are able to select a Location, Add an Asset in Subform 1 and add Meter readings in subform 2.

Subform 2 is linked to Subform 1 using the Unbound Control coloured in Blue.

All of the Controls which are coloured can be hidden.

If you select the Location "Waynesborough Quick Stop 777" you will see all related data.
 

Attachments

  • SEVDatabase.zip
    798.5 KB · Views: 175

LALovelady

New member
Local time
Today, 16:11
Joined
Apr 6, 2021
Messages
17
I have no idea what forms you are talking about. I don't see a form with nested subforms.

BTW, the only way to do this is to use subdatasheets and they leave a lot to be desired. There are other ways. I use two subforms side-by-side. the left form shows a list and when you click on a row, the right form syncs and shows the list that goes with the highlighted record. Here's a picture of a complex version. View attachment 91020 View attachment 91021
Thanks for your feedback.
 

LALovelady

New member
Local time
Today, 16:11
Joined
Apr 6, 2021
Messages
17
Your table structures were not correct because you were using Lookup Fields in your tables.

It is recommended that you use an Autonumber for each table, although some disagree.

I modified the tables so each has its own Autonumber Field.

I redesigned the Form that Opens so that you now are able to select a Location, Add an Asset in Subform 1 and add Meter readings in subform 2.

Subform 2 is linked to Subform 1 using the Unbound Control coloured in Blue.

All of the Controls which are coloured can be hidden.

If you select the Location "Waynesborough Quick Stop 777" you will see all related data.
Thank you for designing that for me. Looks like exactly what I need!
 

mike60smart

Registered User.
Local time
Today, 22:11
Joined
Aug 6, 2017
Messages
1,913
We were glad to help. My design is on the same lines as the one Pat suggested.
 

Users who are viewing this thread

Top Bottom