473,395 Members | 1,488 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Hide column through VBA

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
5 10019
MMcCarthy
14,534 Expert Mod 8TB
The code you are looking for is ...

Expand|Select|Wrap|Line Numbers
  1. Me.Controls("field").Visible = False
  2.  
Jan 9 '10 #2
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
MMcCarthy
14,534 Expert Mod 8TB
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
NeoPa
32,556 Expert Mod 16PB
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
You have to reverse the code on open.

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

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

Similar topics

6
by: Das | last post by:
Hi everyone, I'm using datagrid control to display the data. I want to hide column to be displayed into the data grid. I'm using the code as given below: Method given below is used to bind the...
2
by: Thanh Nu | last post by:
Hi, I would like to hide a column in a web datagrid (with create columns automatically at runtime checked), and I cannot refer to the columns collection like this: DataGrid1.Columns(0).Visible...
2
by: | last post by:
I have a page where I have 3 combo boxes listed in a column. sort of like: combo1 combo2 combo3 Based on which one is clicked, the others are supposed to hide (i.e. combobox.visible =...
5
by: J | last post by:
Ok, they have changed a lot of stuff in VB.net. How in the world do you hide a column on the Datagrid? -- Jason
5
by: dbuchanan | last post by:
Is it possible to detect the SQLS2K column level permission for the logged in user. I want to be able to hide a control or Button based on user permission to edit that column. Can anyone...
3
by: | last post by:
I'm using the DataList and GridView controls, and I am trying to wrap my head around the problem of conditionally showing or hiding cells/cell content based on the presence or absence of DB data. I...
9
by: ghostwolf | last post by:
Hi, I want to hide a column in the asp:GridView, say one of the column of asp:BoundField. But it is not allowed to put <divinside for setting it display:none. What can I do? Thanks in millions.
2
by: Keithb | last post by:
I need to hide a GridView's "edit" column if the user's role does not support editing. However, the column's Visible property does not support databinding. Is there a workaround? Thanks, ...
4
by: Luqman | last post by:
I have populated the Child Accounts and Parent Accounts in a Grid View Control, I want to hide the Select Column of Parent Accounts, but not the Child Accounts, is it possible ? I am using VS...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.