Hiding/Showing Subform Datasheet Columns based on Checkbox Selection
Posted on 2011-04-25
I've tried searching this site for the answer to this, and though I've found a couple similar, perhaps my search terms are not exact, because I'm not able to come up with much.
This is what I have so far:
Main form: frm_AllAssetsMain
Subform (datasheet view) on main form: AllAssetsSubform
Selection Form: frm_ColumnViewSelection
What I'm trying to accomplish. User opens main form, all available columns are visible on subform. User opens frm_ColumnViewSelection and selects via checkbox the columns that they wish displayed on AllAssetsSubform. The state of those checkboxes is then saved and the form closed, and when the form closes, only the columns corresponding to the selected checkboxes on frm_ColumnViewSelection remain visible on AllAssetsSubform. As long as the user does not go back into frm_ColumnViewSelection and change the selection, then for the rest of the users session, only those fields will be seen regardless of any requerying of the subform or whatnot. The user, can however, at any time, go back into the frm_ColumnViewSelection and change the selection of what they view and the view will update accordingly. when the database is closed and then reopened, however, I would like the view to be reset to the default state.
Selection DOES NOT have to be on separate form if that makes it much more difficult to accomplish. I can list checkboxes on AllAssetsMain if I need to.
If more than one person is using db at same time, I need the selections that particular user selects to only be specific to THEIR session, and not changed globally, so that the second user suddenly loses columns because the first user changed the checkboxes selected in their session.
I am an extreme novice when it comes to Access and VBA, I've picked up a thing or two through trial and error and a lot of help on here, but please keep your responses as novice-like as possible. Thank you.