I have a form (set as continuous) with a query as the recordsource. The query brings up about 20 questions as records and allows the user to input the answers. Some answers are numeric and I have a numeric field in the underlying table that is displayed on the form as check boxes in a frame. Some questions have textual answers and I have a memo field, displayed as a text box, to capture them. Each question can have only one type of answer so I wish to hide the checkboxes and frame if the answer is textual or to hide the text box if the answer is numeric. I am trying to use the following code:
Private Sub Form_Load()
On Error GoTo PROC_ERR
If [Answer_type] = "T" Then
Me.frameNumber.Visible = False
Me.txtComment.Visible = True
ElseIf [Answer_type] = "N" Then
Me.txtComment.Visible = False
Me.frameNumber.Visible = True
End If
PROC_EXIT:
Exit Sub
PROC_ERR:
MsgBox Err.Description
Resume PROC_EXIT
End Sub
If the Answer_type field in the query is "T" only the text box should show and, conversly, if the Answer_type field in the record is "N", I want only the frame control (with checkboxes) to show.
I seem to get all or nothing (all frame controls or all text boxes). Each form will always have some numeric and some textual questions. Can anyone help? Thanks
Private Sub Form_Load()
On Error GoTo PROC_ERR
If [Answer_type] = "T" Then
Me.frameNumber.Visible = False
Me.txtComment.Visible = True
ElseIf [Answer_type] = "N" Then
Me.txtComment.Visible = False
Me.frameNumber.Visible = True
End If
PROC_EXIT:
Exit Sub
PROC_ERR:
MsgBox Err.Description
Resume PROC_EXIT
End Sub
If the Answer_type field in the query is "T" only the text box should show and, conversly, if the Answer_type field in the record is "N", I want only the frame control (with checkboxes) to show.
I seem to get all or nothing (all frame controls or all text boxes). Each form will always have some numeric and some textual questions. Can anyone help? Thanks