I have a form that displays it's data in Datasheet view. When I try to set one of the control's visible properties to false (me.txtAddress.Visible = False), it still shows the column in datasheet view. However I notice that if I remove the control completely that it doesn't show the column. How can I hide this column programatically?
What I'm trying to accomplish is giving the user the ability to show or hide certain fields of a query by using a form. I have a form named rptCriteria with a checkbox for each field in the query. The query is bound to a form named frmRecords that opens in datasheet view (I want the users to see a datasheet so they can sort and easily export to Excel, etc.) I thought I could hide and show the fields by simply setting the visible property of each field to the value of the check box on the rptCriteria form:
Me.controlname.visible = [forms]![rptCriteria]![fldCheck].value
But apparently, even if I set the visible property manually, the column is still displayed. Maybe there is an easier way to accomplish this? I'm trying my best not to have to programatically generate the Recordsource SQL string, which could be a nightmare. Thanks for any help you can provide!!
What I'm trying to accomplish is giving the user the ability to show or hide certain fields of a query by using a form. I have a form named rptCriteria with a checkbox for each field in the query. The query is bound to a form named frmRecords that opens in datasheet view (I want the users to see a datasheet so they can sort and easily export to Excel, etc.) I thought I could hide and show the fields by simply setting the visible property of each field to the value of the check box on the rptCriteria form:
Me.controlname.visible = [forms]![rptCriteria]![fldCheck].value
But apparently, even if I set the visible property manually, the column is still displayed. Maybe there is an easier way to accomplish this? I'm trying my best not to have to programatically generate the Recordsource SQL string, which could be a nightmare. Thanks for any help you can provide!!