M
Mark Andrews
I am trying to hide columns in a datasheet view.
If I use
Me.Controls("txtAccountID").ColumnHidden = True
it works perfectly.
Now I would like to loop through all controls and hide all of them, and then
show only 3 columns.
I tried this code with no success.
Can anyone help? (Access2003 in Access2000 format)
Private Sub Form_Open(Cancel As Integer)
Dim ctl As Control
Dim ctlname As String
'Me.Controls("txtAccountID").ColumnHidden = True
'Me.Controls("txtContactID").ColumnHidden = True
For Each ctl In Me.Controls
ctlname = ctl.Properties("Name")
ctl(ctlname).ColumnHidden = True
Next ctl
End Sub
Thanks in advance,
Mark
If I use
Me.Controls("txtAccountID").ColumnHidden = True
it works perfectly.
Now I would like to loop through all controls and hide all of them, and then
show only 3 columns.
I tried this code with no success.
Can anyone help? (Access2003 in Access2000 format)
Private Sub Form_Open(Cancel As Integer)
Dim ctl As Control
Dim ctlname As String
'Me.Controls("txtAccountID").ColumnHidden = True
'Me.Controls("txtContactID").ColumnHidden = True
For Each ctl In Me.Controls
ctlname = ctl.Properties("Name")
ctl(ctlname).ColumnHidden = True
Next ctl
End Sub
Thanks in advance,
Mark