Forum Discussion
Tony2021
Dec 31, 2021Steel Contributor
ColumnHidden Property - Doesnt seem to hide
Hello, is the below the correct code to turn on/off the columnhidden in a datasheet? Me.txtProjName2.ColumnHidden = True Me.txtProjName2.ColumnHidden = False I have opened the form and rig...
Tony2021
Steel Contributor
George, I have found the answer. The previously posted codes do not work on a split form. Only the below works for a split form. I searched quite a bit online. Many websites do not state that a split form requires different codes. Anyways, I am using the below and it works great. thank you for the assistance. I can use the other codes on another form to auto fit the fields.
Private Sub txthide_Click()
'Me.txtProjectName.ColumnHidden = True 'this doesnt work on a split form
Screen.ActiveDatasheet.txtProjectName.ColumnHidden = True
End Sub
Private Sub txtUnhide_Click()
'Me.txtProjectName.ColumnHidden = False 'this doesnt work on a split form
Screen.ActiveDatasheet.txtProjectName.ColumnHidden = False
End Sub
Private Sub txthide_Click()
'Me.txtProjectName.ColumnHidden = True 'this doesnt work on a split form
Screen.ActiveDatasheet.txtProjectName.ColumnHidden = True
End Sub
Private Sub txtUnhide_Click()
'Me.txtProjectName.ColumnHidden = False 'this doesnt work on a split form
Screen.ActiveDatasheet.txtProjectName.ColumnHidden = False
End Sub
George_Hepworth
Jan 01, 2022Silver Contributor
I'm glad to hear you worked it out. Continued success with the project.