Hello. I have a form I use to track survey responses. I have certain questions disappear when certain departments are checked, using the following code on the afterupdate event of the department list box:
Private Sub Department_AfterUpdate()
Select Case Me.Department
Case "Construction Services"
Me.Cextent.Visible = False
Me.Sresponse.Visible = False
Me.Efield.Visible = True
Case "Environmental"
Me.Cextent.Visible = True
Me.Sresponse.Visible = True
Me.Efield.Visible = False
Case "Geotechnical"
Me.Cextent.Visible = True
Me.Sresponse.Visible = True
Me.Efield.Visible = False
End Select
End Sub
It works fine when the survey is first entered. But when I go back to the record, all the fields are visible. How can I have those fields stay invisible on reloading the form? I tried pasting the code above into the OnCurrent or OnLoad events of the form itself, and got nowhere.
Margaret
Private Sub Department_AfterUpdate()
Select Case Me.Department
Case "Construction Services"
Me.Cextent.Visible = False
Me.Sresponse.Visible = False
Me.Efield.Visible = True
Case "Environmental"
Me.Cextent.Visible = True
Me.Sresponse.Visible = True
Me.Efield.Visible = False
Case "Geotechnical"
Me.Cextent.Visible = True
Me.Sresponse.Visible = True
Me.Efield.Visible = False
End Select
End Sub
It works fine when the survey is first entered. But when I go back to the record, all the fields are visible. How can I have those fields stay invisible on reloading the form? I tried pasting the code above into the OnCurrent or OnLoad events of the form itself, and got nowhere.
Margaret