Hide columns in a Microsoft Access 2007 data table using VBA

I am trying to hide specific columns in an Access 2007 split form using code. I need a form to check certain conditions, to see if a column needs to be displayed or not. I have code in the "Activate" form to hide the column as follows:

txtControl.ColumnHidden = True

This code works in the "Open" event, but if I hide the "Activate" column, it will not display these changes until I close the form and open it again. I tried calling the form refresh, redraw, and query methods, but that would not work. Please, help!

Edit: Ideally, I need this event to happen when the focus switches to this form. This is why I use the Activate event, not the Open event.

+3
source share
2 answers

Current, . , , : Me.TextControl.Requery Current , , . , , , , , . , , , , .

+7

, Access 2002. , , .

Me.SubForm.SourceObject = Me.SubForm.SourceObject
Me.SubForm.Requery

, .

0

Source: https://habr.com/ru/post/1722615/


All Articles