On a subform I have a combo (cboType)
Based on the selection of that combo, I have certain controls on the form that should be visible and the rest false. I created a Case Select statement on the after update of that combo, to set the subform controls visible and invisible.
A couple of questions I have -
1) besides for after update of the combo, where else should I put this, to make sure that the form is always looking appropriately?
2) how do I handle null, i.e there is no record yet (so only the cboType combo should be visible)
3) How do ensure that during main form load, and navigation, this is form's controls visible status is updated?
4) While separate, and more of a layout thing, one of my choices only uses 1 date field and the comments field, while the others have a bunch of fields in use. How do I set the layout, so that when it is just the date field and comments field it doesn't have a huge space in the form (reserved for the invisible fields).
This is my current case select code, so you can see it:
Thanks for any help!!!
Based on the selection of that combo, I have certain controls on the form that should be visible and the rest false. I created a Case Select statement on the after update of that combo, to set the subform controls visible and invisible.
A couple of questions I have -
1) besides for after update of the combo, where else should I put this, to make sure that the form is always looking appropriately?
2) how do I handle null, i.e there is no record yet (so only the cboType combo should be visible)
3) How do ensure that during main form load, and navigation, this is form's controls visible status is updated?
4) While separate, and more of a layout thing, one of my choices only uses 1 date field and the comments field, while the others have a bunch of fields in use. How do I set the layout, so that when it is just the date field and comments field it doesn't have a huge space in the form (reserved for the invisible fields).
This is my current case select code, so you can see it:
Code:
Select Case Me.cboType
Case 1
Me.cboSubType.Visible = True
Me.dtDate1.Visible = True
Me.txtComments.Visible = True
Me.cboPerson1.Visible = False
Me.cboPerson2.Visible = False
Me.cboPerson3.Visible = False
Me.dtDate2.Visible = False
Me.dtDate3.Visible = False
Me.txtNameSpec.Visible = False
Me.dtDate4.Visible = False
Me.cboPerson1Type.Visible = False
Me.cboPerson2Type.Visible = False
Me.cboPerson3Type.Visible = False
Case 2
Me.cboSubType.Visible = True
Me.dtDate1.Visible = False
Me.txtComments.Visible = True
Me.cboPerson1.Visible = True
Me.cboPerson2.Visible = False
Me.cboPerson3.Visible = False
Me.dtDate2.Visible = True
Me.dtDate3.Visible = False
Me.txtNameSpec.Visible = False
Me.dtDate4.Visible = False
Me.cboPerson1Type.Visible = True
Me.cboPerson2Type.Visible = False
Me.cboPerson3Type.Visible = False
Case 3
Me.cboSubType.Visible = False
Me.dtDate1.Visible = False
Me.txtComments.Visible = True
Me.cboPerson1.Visible = False
Me.cboPerson2.Visible = True
Me.cboPerson3.Visible = True
Me.dtDate2.Visible = False
Me.dtDate3.Visible = True
Me.txtNameSpec.Visible = True
Me.dtDate4.Visible = True
Me.cboPerson1Type.Visible = False
Me.cboPerson2Type.Visible = True
Me.cboPerson3Type.Visible = True
Case 4
Me.cboSubType.Visible = True
Me.dtDate1.Visible = False
Me.txtComments.Visible = True
Me.cboPerson1.Visible = True
Me.cboPerson2.Visible = False
Me.cboPerson3.Visible = False
Me.dtDate2.Visible = True
Me.dtDate3.Visible = False
Me.txtNameSpec.Visible = False
Me.dtDate4.Visible = False
Me.cboPerson1Type.Visible = True
Me.cboPerson2Type.Visible = False
Me.cboPerson3Type.Visible = False
Case 5
Me.cboSubType.Visible = True
Me.dtDate1.Visible = False
Me.txtComments.Visible = True
Me.cboPerson1.Visible = True
Me.cboPerson2.Visible = False
Me.cboPerson3.Visible = False
Me.dtDate2.Visible = True
Me.dtDate3.Visible = False
Me.txtNameSpec.Visible = False
Me.dtDate4.Visible = False
Me.cboPerson1Type.Visible = True
Me.cboPerson2Type.Visible = False
Me.cboPerson3Type.Visible = False
End Select
Thanks for any help!!!