How to show/hide columns in a query using a form checkbox?

cykchanaa

New member
Local time
Today, 17:22
Joined
Jul 17, 2015
Messages
5
Currently I have a query where the criteria is dependent on the combo boxes on my form. I would like to add checkboxes to my form which determines which fields are shown or hidden. For example if I had a checkbox for address, selecting it on my form will show the address column in my query results. I am very new to access and have not been able to find a solution to a similar task online.

Any help would be greatly appreciated.
 
This would be easier if you make a form based on the query and display that form in datasheet view. Then it is much easier to show and hide the columns of the form, which each have a ColumnHidden property. That property is not available for columns in a query.
 
This would be easier if you make a form based on the query and display that form in datasheet view. Then it is much easier to show and hide the columns of the form, which each have a ColumnHidden property. That property is not available for columns in a query.

Thanks for the suggestion, what I'm trying to do is to create a report based on that query and have a button opening that report on my form. However when I insert the query as a subform in datasheet view, hiding the columns has no effect on the report.
 
what I'm trying to do is to create a report based on that query and have a button opening that report on my form.
I don't understand. There was no mention of a report in your first post. In this post you want to open "that report on [your] form?" I don't believe you can open a report on a form.

However when I insert the query as a subform in datasheet view, hiding the columns has no effect on the report.
A query only has a datasheet view, and you can't hide its columns, so I don't understand. How would hiding columns in a query affect a report?

Sorry, I don't understand.
 
Sorry for the confusion, I intend to generate a report based on my query and want users to have the option to choose which fields are shown in that report. I have attached a sample database for your reference.
 

Attachments

Users who are viewing this thread

Back
Top Bottom