Answered by:
Spreading a single form over multiple tabs

Question
-
Hello:
I have a single form that is so large it needs to be spread over multiple tabs. On most of my apps, a single tab is enough.
What would be the best way to open multiple tabs, spread the input over multiple tabs, and then not proceed with updating the underlying table(s) until all the tabs are completed? One of the tabs will have a parent/child relationship where the sub-form can have multiple rows that link to the primary form's key.
Suggestions?
Thanks,
Rich Locus, Logicwurks, LLC
Tuesday, September 8, 2020 7:38 PM
Answers
-
In my experience, my tabs are different tables/forms. Also for performance optimization look into dynamically loading your tab content, this way it only gets loaded if a user actually clicks on the tab.
Daniel Pineault, 2010-2019 Microsoft MVP
Professional Support: http://www.cardaconsultants.com
MS Access Tips and Code Samples: http://www.devhut.net- Marked as answer by RichLocus Wednesday, September 9, 2020 3:04 PM
Tuesday, September 8, 2020 10:12 PM -
..............and then not proceed with updating the underlying table(s) until all the tabs are completed? One of the tabs will have a parent/child relationship where the sub-form can have multiple rows that link to the primary form's key.
For an illustration of how to enforce the insertion of a row in a referencing table to which a subform is bound, you might like to take a look at Families.zip in my public databases folder at:
https://onedrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169
This little demo file includes, amongst other things, a form in which the user cannot move off the current record or close the form until at least one row has been inserted in the subform. It is of course not possible to prevent the parent form's current record being saved when focus is moved to the subform, so the way in which the demo works is that code in the parent form's module will, after a new record in the parent form is saved, navigate back to that record until at least one row exists in the referencing table.
The fact that your parent form and subform are spread over multiple pages of a tab control is not relevant to this issue per se, but you'd probably want to add code to select the page on which the subform is located if no record has been entered in the subform.As regards validating that data has been entered into controls in the parent form on multiple pages of the tab control, this can be done in the parent form's BeforeUpdate event procedure. This includes a Cancel argument whose return value can be set to True if any validation criteria are not satisfied.
Ken Sheridan, Stafford, England
- Marked as answer by RichLocus Wednesday, September 9, 2020 3:04 PM
Tuesday, September 8, 2020 11:21 PM
All replies
-
In my experience, my tabs are different tables/forms. Also for performance optimization look into dynamically loading your tab content, this way it only gets loaded if a user actually clicks on the tab.
Daniel Pineault, 2010-2019 Microsoft MVP
Professional Support: http://www.cardaconsultants.com
MS Access Tips and Code Samples: http://www.devhut.net- Marked as answer by RichLocus Wednesday, September 9, 2020 3:04 PM
Tuesday, September 8, 2020 10:12 PM -
..............and then not proceed with updating the underlying table(s) until all the tabs are completed? One of the tabs will have a parent/child relationship where the sub-form can have multiple rows that link to the primary form's key.
For an illustration of how to enforce the insertion of a row in a referencing table to which a subform is bound, you might like to take a look at Families.zip in my public databases folder at:
https://onedrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169
This little demo file includes, amongst other things, a form in which the user cannot move off the current record or close the form until at least one row has been inserted in the subform. It is of course not possible to prevent the parent form's current record being saved when focus is moved to the subform, so the way in which the demo works is that code in the parent form's module will, after a new record in the parent form is saved, navigate back to that record until at least one row exists in the referencing table.
The fact that your parent form and subform are spread over multiple pages of a tab control is not relevant to this issue per se, but you'd probably want to add code to select the page on which the subform is located if no record has been entered in the subform.As regards validating that data has been entered into controls in the parent form on multiple pages of the tab control, this can be done in the parent form's BeforeUpdate event procedure. This includes a Cancel argument whose return value can be set to True if any validation criteria are not satisfied.
Ken Sheridan, Stafford, England
- Marked as answer by RichLocus Wednesday, September 9, 2020 3:04 PM
Tuesday, September 8, 2020 11:21 PM