Solved Syncronizing two related subforms (1 Viewer)

Gasman

Enthusiastic Amateur
Local time
Today, 06:34
Joined
Sep 21, 2011
Messages
14,299
Hi Mike & Gasman, FYI this is the video I followed to set up the tab control ( in case I'm not explaining it properly. When you click on each tabbed control I would like each respective subform to be displayed, even when there is no data in it. Would it be better to set up tab control the conventional way.....cause I'm thinking it'll solve problem (albeit result in longer load times).
No, because if there is no data, the subform will still not be displayed.
 

SuperSonicSam

New member
Local time
Today, 15:34
Joined
Jul 16, 2023
Messages
23
I'm wondering how you're supposed to enter data, if subform not displayed....doesn't seem right
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:34
Joined
Sep 21, 2011
Messages
14,299
Well I was trying to see why subform5 did not load. I believe it was because there was no data for my record id6. I changed one record for that subform to 6 and then it displayed. The last two subforms 7 & 8 are blank anyway? :)

Try it yourself, select a student whose ID is not in Spelling. Anything but 2 really. :)
 

SuperSonicSam

New member
Local time
Today, 15:34
Joined
Jul 16, 2023
Messages
23
Gasman- you are miles ahead of me! I was just super happy to see the subforms re-appear. Upon closer inspection, however, I see what you mean about subform 5 (i.e. spelling) not loading. I have the same latest version of the database you have. At the moment I have no idea why subform5 didn't load initially like the other tabbed subforms, but strangely, after I opened up subform5 directly (i.e. not via 'SyncSubForms') and then closed it again - it then worked from the correct tab in the 'SyncSubForms' form! I didn't even change a thing! Strange....🤷‍♂️
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:34
Joined
Sep 21, 2011
Messages
14,299
Actually I was only looking at id2. The others still don't appear.
Yes, that is what I found as well. If you change a record in spelling to another ID and then select that record in the left subform and then select spelling it will show that data. That is why I believe that is the issue. I have also seen it mentioned that if no data is available to any controls then none are shown, so if you can populate one control (even the ID) then the rest should show.

This is beyond my expertise thousgh. :(
 

SuperSonicSam

New member
Local time
Today, 15:34
Joined
Jul 16, 2023
Messages
23
Fixed! In the spelling query I had the one-to-many relationship set wrong. I just changed it from ID to IDauto in the 'student details' table......definitley within your expertise Gasman! Thanks again Mike & Gasman! :giggle:
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:34
Joined
Sep 21, 2011
Messages
14,299
Fixed! In the spelling query I had the one-to-many relationship set wrong. I just changed it from ID to IDauto in the 'student details' table......definitley within your expertise Gasman! Thanks again Mike & Gasman! :giggle:
Nicely done. (y)
I would also just say, that if you renamed your subforms better (0 to 7) then you can get the correct form with just a one liner.
It also means if you add another tab, you do not need to recode the Case statment?

Code:
Me.SubformContainer.SourceObject = "subfrmTab" & CStr(Me.tabctlEval)

Also as I mentioned before, give your ID fields better names and avoid having spaces in field/control names. Just causes more work for you.
You can have whatever caption you want , so LastName can show as Last Name.
 

Users who are viewing this thread

Top Bottom