By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,896 Members | 1,983 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,896 IT Pros & Developers. It's quick & easy.

Using form Listbox to select query fields/columns

P: 4

I have a query which calculates a large number of fields for each record, i don't want all of the fields present in the datasheet view only those fields selected by the user in a list box(or similar).

Therefore, how can i add a list box (field listing of a table/query) to a form from which the user can select which of the available fields they want to see in the query output (i.e. has the same effect as checking/unchecking the "Show" checkbox for each field on the standard query design grid)?

I think i need to build the query on the fly using the fields selected from the list box as the column headings / or make those selections turn on the "Show" checkbox in the design grid (this is only a guess). But don't really know where to start.

Any help gratefully received.
Dec 10 '08 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 1,287
You can use the ColumnHidden property of the fields in the datasheet to hide/show the appropriate fields.

SubformControlName!FieldName.ColumnHidden = -1

ColumnHidden Property¬*[Access 2007 Developer Reference]
Dec 10 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.