This video is part of a series on extending the functionality of continuous forms, using code to add features available in datasheet forms.
The video demonstrates a simple method for selectively hiding / restoring columns in a continuous form at runtime. This is done by double clicking the column header label. All other columns are moved across leaving no gaps. The hidden columns are listed in a combobox and can be restored to their original positions one at a time or all at once.
The code to do this uses a VBA dictionary and accessibility code to 'pair' the header label with its 'associated control'
Related article with example app and all code: https://isladogs.co.uk/hide-restore-s...
Times:
0:00 Intro
0:22 Manage columns in datasheet forms
1:01 Hide/Restore columns in Continuous Form
1:51 DEMO - showing built-in functionality to manage columns in datasheets at runtime
3:01 DEMO - add feature to hide/restore columns in continuous form at runtime by double clicking header label
4:02 Explaining the VBA code used
4:30 Create dictionary to store names, positions & widths of control and header labels when form is opened
5:20 A function ShrinkSelectedColumn uses accessibility code to identify control from its 'associated label' and then shrink to minium width od 1 twip (1440 twips = 1 inch ; 567 twips = 1 cm)
7:33 Function runs when header label is double clicked, shrinks label and associated control then moves all other columns across to fill gap.
7:48 Restore column(s) by selecting in combo box or clicking a button. This restores column to original width and position using dictionary data and again moves other columns across
8:06 Summary of approach used
9:10 Thanks for watching. Please like, leave a comment & subscribe.