Continuous Form: Hide/Unhide and Arrange Columns

tkepongo

Registered User.
Local time
Today, 15:07
Joined
Jul 15, 2011
Messages
45
Does anyone know if it is possible to have a button that will hide/unhide columns in a continuous form and rearrange them? For example

Current Continuous Form
Code:
|Column1||Column2||Column3||Column4||Column5||Column6|

Then when you click a checkbox or something, it looks like
|Column1||Column5||Column6|

So it has to hide Columns 2-4, and then move Column 5 and 6 over to the left so there are no gaps in between
 
Something like...

Code:
Me.Controls("NameOfControl").ColumnHidden = True

...however, not sure that will work if the form is not in Datasheet view.
 
Something like...

Code:
Me.Controls("NameOfControl").ColumnHidden = True

...however, not sure that will work if the form is not in Datasheet view.
Quite right Gina!

@tkepongo: You can use the Visible property but you will need to rearrange the controls everytime you hide/unhide them.
 
hide and unhide - no problem.

somecontrol.visible = true/false


re-arrange - very difficult.

if you need to rearrange/resize etc, then probably use a datasheet - although then you don't have the flexibility to add command buttons etc.


note that you can also use the enabled and locked property to change appearance - notably, set both to false/no to "gray" a control
 
The left & visible properties can do it, but as above it won't be simple as you will need to calculate new left values based on which controls are visible and which order they are in.

And moving / hiding a single control will mean the left properties of all other controls will have to be re-evaluated to see if the hidden control was to the left of it (in which case it, and all controls further left, will have to be adjusted).
 

Users who are viewing this thread

Back
Top Bottom