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

Hide column through VBA

P: 6
How do I hide columns in a split form through VBA? I tried this:
Expand|Select|Wrap|Line Numbers
  1. Me.Controls("field").ColumnHidden = True
but i have to close the form and open it again to see the change. Nor does adding this help.
Expand|Select|Wrap|Line Numbers
  1. Me.Requery
  2. Me.Refresh
  3. Me.Repaint
Any ideas?
Thank you in advance.
Jan 9 '10 #1
Share this Question
Share on Google+
5 Replies

Expert Mod 10K+
P: 14,534
The code you are looking for is ...

Expand|Select|Wrap|Line Numbers
  1. Me.Controls("field").Visible = False
Jan 9 '10 #2

P: 6
Not working for me. But i do know if i close the form, and then open it again, it wont show up, yet none of the refresh commands work.
What I am trying to do is have a split form with an option group on top. There I can select what group of columns I want to see(or all of them). Is there maybe a better way to do that?
Jan 9 '10 #3

Expert Mod 10K+
P: 14,534
Sorry about the double posting. We are having some technical problems at the moment that we are attempting to sort.

Setting the visible property of a field to false will hide the field. Setting it to true will show it. You need to post the code you are using to trigger when this action is taking place. What event are you using and what conditions are you putting in to make the textbox visible and invisible?
Jan 9 '10 #4

Expert Mod 15k+
P: 31,492
I think you need to be a little clearer trying to explain what happens. I can't follow exactly what you experience from your explanation. It makes it hard to know what to suggest.
Jan 11 '10 #5

P: n/a
You have to reverse the code on open.

Me.Controls("field").ColumnHidden = False
Nov 24 '10 #6

Post your reply

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