Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a form that calls a subform

Status
Not open for further replies.

Zorro1265

Technical User
Nov 14, 2000
181
US
I have a form that calls a subform with a second subform inside it. The 2nd subform is in datasheet view. I want to hide columns depending on the setting of a combobox on the first subform. I can get the fields hidden but they wont unhide when the combobox value changes. Any ideas?

'If Forms![StressInterp]![subfrmStressData]![stress_protocol] <> 5 Then
'Me.MPH.ColumnHidden = False
'End If
'If Me.stress_protocol <> &quot;5&quot; Then
'Me.MPH.ColumnHidden = False
'Me.Grade.ColumnHidden = False
'Me.Mets.ColumnHidden = False
'End If
'If Me.stress_protocol = &quot;5&quot; Then
'Me.MPH.ColumnHidden = True
'Me.Grade.ColumnHidden = True
'Me.Mets.ColumnHidden = True
'Me.Minutes.ColumnWidth = 2880
'End If
 
I do not have a lot of experience with datasheet views as I just don't like the look of them and typically build continuous forms instead, but I will offer that you set the columnwidth property to 0 instead of trying to hide the column. The reaction is I believe what you want however the only drawback is that a savvy user can pull the column back &quot;open&quot; if they chose. Anyone? Anyone?
 
ghubbell,

I have tried that one too. As with the other setting it will make the columns hidden all the time, not based on my combobox. I am perplexed.
 
For all controls that are part of a subform(or subsubform) you must use the &quot;fullpath&quot; to the control:

Forms!MainFormname!SubFormName!SubSubFormName!ControlName
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top