Hide columns in the datasheet part of a split form

A

Abbas

I have created a split form in Access 2007; I have added a number of fields
to this form; some are bound to the source table and some are not. All the
fields are displayed in the both form pane and the datasheet part.

Is there a way to hide or show selected fields (columns) in the datasheet? I
know you can hide them manually on the form.

Thanks for your advice.

Abbas
 
F

fredg

I have created a split form in Access 2007; I have added a number of fields
to this form; some are bound to the source table and some are not. All the
fields are displayed in the both form pane and the datasheet part.

Is there a way to hide or show selected fields (columns) in the datasheet? I
know you can hide them manually on the form.

Thanks for your advice.

Abbas

Select the datasheet column by clicking in the column header.
Then right-click and select Hide Column.

To unhide the column click anywhere off of the datasheet table (on the
background).
Select Unhide Columns and place a check in whatever columns you wish
to show. You can also use this to hide columns by unchecking the
column here.
 
A

Abbas

Thanks for your reply; but I want to hide/show colums 'programatically';
sorry the word was missed out in my previous post.

thanks
Abbas
 
F

fredg

Thanks for your reply; but I want to hide/show colums 'programatically';
sorry the word was missed out in my previous post.

thanks
Abbas

Look up the ColumnHidden property in VBA help.
 
A

Abbas

Thanks Fred; used the follwoing comamnd and it worked perfectly.

Me.cmbBox.ColumnHidden = True
 
Joined
Jun 3, 2015
Messages
2
Reaction score
0
PLEASE HELP! This is my first post and I really hope someone can help me with this please, I spent two days trawling the internet and trying different methods to get this to work. Im not sure if its my lack of knowledge or whether its just MS Access that is at fault.

I am pretty new to VBA and I am having the same problem of hiding and un-hiding columns on a datasheet of a split form. I am building a system that will be used in front of customer and therefore wish to hide columns that contain cost sensitive data. The same forms need to be able to show the Sales Rep the hidden columns simply by ticking a box. Basically a toggle on and off of hidden columns.

I have been playing around with the code below (which i found in another forum) to hide the Field called COO when I click the tick box called chkHIdeFields check box. This works on a Single form but not on a datasheet of a split form.

Private Sub chkHideFields_Click()
' Note: vbTrue = -1
If Me.chkHideFields = vbTrue Then
Me.COO.Visible = True
Else: Me.COO.Visible = False
End If
End Sub

I have been able to hide the column of my split form by using the ColumnHidden property of the On Load event just as a proof of concept that the ColumnHidden property actually works to hide a column, which it does. This is the code that im using to hide the column called COO.

Me.COO.ColumnHidden = True

However if I then set it to = False and then close and open the form, it doesn't unhide the column. the only way I can unhide the column is to do it from the Form view via the un-hide dialogue pop up box.

i have two issues here, the first one is getting the form to recognize when to hide and when to show the column of the datasheet on the split form and the second is to get the code to for the check box method.

Lastly once I get it working for 1 field I need to be able to define a list of 7 or 8 other fields all at the same time.

I have tried to upload a small access database containing everything Ive tried but it wont let me upload so if someone can help me and would like my Access db please advise how I can supply this to you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top