I am trying to hide some controls in a form in MS Access. The idea is that a linked table has a type of question such as OpenResponse or OptionBox. Given this input I want to switch the type of input the user can input. Here is a sample of what I have:
Private Sub QuestionType_AfterUpdate()
Dim QType As String
Set QType = Me.QuestionType.Value
Select Case QType
Case OpenResponse
Forms("Survey").Controls(AnswerField).Visible = True
Forms("Survey").Controls(OptionTitle).Visible = False
Forms("Survey").Controls(OptionFrame).Visible = False
Forms("Survey").Controls(Option69).Visible = False
Forms("Survey").Controls(Option70).Visible = False
Forms("Survey").Controls(Option71).Visible = False
Forms("Survey").Controls(Option72).Visible = False
Forms("Survey").Controls(Option73).Visible = False
Forms("Survey").Controls(Option74).Visible = False
Forms("Survey").Controls(Option75).Visible = False
Forms("Survey").Controls(Option76).Visible = False
Forms("Survey").Controls(Option77).Visible = False
Forms("Survey").Controls(Option78).Visible = False
Case OptionBox
Forms("Survey").Controls(AnswerField).Visible = False
Forms("Survey").Controls(OptionTitle).Visible = True
Forms("Survey").Controls(OptionFrame).Visible = True
Forms("Survey").Controls(Option69).Visible = True
Forms("Survey").Controls(Option70).Visible = True
Forms("Survey").Controls(Option71).Visible = True
Forms("Survey").Controls(Option72).Visible = True
Forms("Survey").Controls(Option73).Visible = True
Forms("Survey").Controls(Option74).Visible = True
Forms("Survey").Controls(Option75).Visible = True
Forms("Survey").Controls(Option76).Visible = True
Forms("Survey").Controls(Option77).Visible = True
Forms("Survey").Controls(Option78).Visible = True
End Select
End Sub