The goal is to allow the user to hide or unhide columns of a subform in datasheet view. The datasheet is a subform and bound to a stored procedure. I'd like the main form to have two list boxes: one showing the user the list of currently visible columns, and the other listbox showing currently hidden columns. Then allow the user the hide or unhide the datasheet columns as needed.
First I need to populate each list box by reading the ColumnHidden property for each column in the datasheet. Then I need to update the ColumnHidden property if the user updates a listbox (by selecting an item and sending it to the other listbox with a button).
I'm having trouble populating the list boxes as I cannot successfully reference the columns in the datasheet subform. I'm hoping someone can point me in the right direction here.
I realize this function is sort of built-in by right clicking a column header of a datasheet and then selecting Unhide Fields, then checking and unchecking columns as desired. I've been tasked with this as my boss is of the opinion that the built-in feature is not user friendly enough. (He objects to the name of the dialog box as it could be used simply to hide columns rather than unhide them.)