Afterupdate() hide a column on subform

Delid4ve

Beginner but fast learner
Local time
Today, 13:29
Joined
Oct 6, 2015
Messages
50
I have a case statement to show hide fields as applicable.

I need to hide/show a couple of fields in the subform based on the main form selection but cannot work out how i have to reference this in my statement.
Mani Form = Record
Subform = Record_Cylinders
Field to hide = QtyUsedRecovered

This is part of my case statement for the main form:
Private Sub DocumentType_AfterUpdate()
Select Case Me.DocumentType.Value
Case "Collection Note"
Me.Combo31.Visible = True
Me.Combo33.Visible = True
Me.CollectionDate.Visible = True
Me.Combo41.Visible = True
Me.Combo35.Visible = False
Me.Combo37.Visible = False
Me.Combo43.Visible = False
Me.Combo39.Visible = False
Me.ReturnDate.Visible = False
Me.DisposalType.Visible = False
Me.QtyDisposed.Visible = False
 
depend where you are, in main form, module or subform...
forms!mainform.subform.form.fieldtohide.visible = false is the long version
 
Thanks

By long version I assume you mean that this works anywhere.
 
if your subform is a datasheet, then visible won't work - you need to set the columnwidth to 0 or columnhidden to true
 

Users who are viewing this thread

Back
Top Bottom