Hide Subform Column

GreenshootProgrammer

Registered User.
Local time
Today, 15:01
Joined
Jan 16, 2013
Messages
74
How do I make a column invisible in my subform when the main form loads?
 
In a form in datasheet mode, you can hide a column using a control's columnhidden property. Set it to True. So to hide a column on a subform from code on a parent form you might do something like . . .
Code:
Private Sub Form_Load()
[COLOR="Green"]   'verify that the subform in the control is the we expect[/COLOR]
   If Me.SubformControlName.Form.Name = "ExpectedFormName" Then
      Me.SubformControlName.Form.ControlNameToHide.ColumnHidden = True
   End If
End Sub
So we check the name of the form in the subform control, and then we hide a column on that form.
 
Doesn't work :( (the form's called frmMain and the sub form is called sfrmMain btw. Also do I use the label or textbox control name?)
 
Doesn't work with what symptoms? The subform is in datasheet mode?
 

Users who are viewing this thread

Back
Top Bottom