D
drcanaday
Have a form with a question. The check boxes are answer options. If they only
select Q3_Friends, then the NextQuestion is enabled.
If they select any other combination of checkboxes, then another question
displays on the form. Answer that question and then get NextQuestion.
Have looked at the code so long, I can’t find the error.
‘==========Code Below==============
Private Sub Form_Open(Cancel As Integer)
With Me
.Q3_Newspaper.Value = getItem("Q3_Newspaper")
.Q3_Radio.Value = getItem("Q3_Radio")
.Q3_Signs.Value = getItem("Q3_Signs")
.Q3_FEMA.Value = getItem("Q3_FEMA")
.Q3_Local.Value = getItem("Q3_Local")
.Q3_Friends.Value = getItem("Q3_Friends")
.Q3_Flyers.Value = getItem("Q3_Flyers")
.Q3_Other.Value = getItem("Q3_Other")
.Q3_Other_Text.Value = getItem("Q3_Other_Text")
.Q3a.Value = getItem("Q3a")
.Q3b_Text.Value = getItem("Q3b_Text")
End With
If Q3_Radio.Value = True Then
Q3_Text.Visible = True
Q3a.Visible = True
Else
If Q3_Signs.Value = True Then
Q3_Text.Visible = True
Q3a.Visible = True
Else
If Q3_Local.Value = True Then
Q3_Text.Visible = True
Q3a.Visible = True
Else
If Q3_FEMA.Value = True Then
Q3_Text.Visible = True
Q3a.Visible = True
Else
If Q3_Flyers.Value = True Then
Q3_Text.Visible = True
Q3a.Visible = True
Else
If Q3_Newspaper.Value = True Then
Q3_Text.Visible = True
Q3a.Visible = True
Else
If Q3_Other.Value = True Then
Q3_Text.Visible = True
Q3a.Visible = True
Q3_Other_Text.Visible = True
Q3a.SetFocus
If Q3a.Text = "2. Not Very Effective" Or Q3a.Text = "1. Not At All Effective"
Then
Q3b.Visible = True
Label113.Visible = True
Q3b_Text.Visible = True
Q3b_Text.SetFocus
Else
Q3b_Text.Visible = False
Q3b_Text = Null
Q3b_Text.Value = ""
If Q3a.Text = "5. Extremely Effective" Or Q3a.Text = "4. Very Effective" Or
Q3a.Text = "3. Effective" Or Q3a.Text = "Don't Know/No Opinion" Then
Q3b_Text.Visible = False
If Q3.Value <> "" Then
Label115.Visible = False
Q3a.Visible = False
Q3b_Text.Visible = False
NextQuestion.Enabled = True
Else
NextQuestion.Enabled = False
End If
Else
Q3b.Visible = False
Label113.Visible = False
Q3b_Text.Visible = False
End If
‘ Else =====changed 7_30noon
' Q3_Text.Visible = False
' Q3a.Visible = False
' Q3_Other_Text.Visible = False
' Q3_Other_Text = Null
' HL3_Other_Text_COMM.Visible = False
End If
End If
End If
End If
End If
End If
End If
End If
End Sub
select Q3_Friends, then the NextQuestion is enabled.
If they select any other combination of checkboxes, then another question
displays on the form. Answer that question and then get NextQuestion.
Have looked at the code so long, I can’t find the error.
‘==========Code Below==============
Private Sub Form_Open(Cancel As Integer)
With Me
.Q3_Newspaper.Value = getItem("Q3_Newspaper")
.Q3_Radio.Value = getItem("Q3_Radio")
.Q3_Signs.Value = getItem("Q3_Signs")
.Q3_FEMA.Value = getItem("Q3_FEMA")
.Q3_Local.Value = getItem("Q3_Local")
.Q3_Friends.Value = getItem("Q3_Friends")
.Q3_Flyers.Value = getItem("Q3_Flyers")
.Q3_Other.Value = getItem("Q3_Other")
.Q3_Other_Text.Value = getItem("Q3_Other_Text")
.Q3a.Value = getItem("Q3a")
.Q3b_Text.Value = getItem("Q3b_Text")
End With
If Q3_Radio.Value = True Then
Q3_Text.Visible = True
Q3a.Visible = True
Else
If Q3_Signs.Value = True Then
Q3_Text.Visible = True
Q3a.Visible = True
Else
If Q3_Local.Value = True Then
Q3_Text.Visible = True
Q3a.Visible = True
Else
If Q3_FEMA.Value = True Then
Q3_Text.Visible = True
Q3a.Visible = True
Else
If Q3_Flyers.Value = True Then
Q3_Text.Visible = True
Q3a.Visible = True
Else
If Q3_Newspaper.Value = True Then
Q3_Text.Visible = True
Q3a.Visible = True
Else
If Q3_Other.Value = True Then
Q3_Text.Visible = True
Q3a.Visible = True
Q3_Other_Text.Visible = True
Q3a.SetFocus
If Q3a.Text = "2. Not Very Effective" Or Q3a.Text = "1. Not At All Effective"
Then
Q3b.Visible = True
Label113.Visible = True
Q3b_Text.Visible = True
Q3b_Text.SetFocus
Else
Q3b_Text.Visible = False
Q3b_Text = Null
Q3b_Text.Value = ""
If Q3a.Text = "5. Extremely Effective" Or Q3a.Text = "4. Very Effective" Or
Q3a.Text = "3. Effective" Or Q3a.Text = "Don't Know/No Opinion" Then
Q3b_Text.Visible = False
If Q3.Value <> "" Then
Label115.Visible = False
Q3a.Visible = False
Q3b_Text.Visible = False
NextQuestion.Enabled = True
Else
NextQuestion.Enabled = False
End If
Else
Q3b.Visible = False
Label113.Visible = False
Q3b_Text.Visible = False
End If
‘ Else =====changed 7_30noon
' Q3_Text.Visible = False
' Q3a.Visible = False
' Q3_Other_Text.Visible = False
' Q3_Other_Text = Null
' HL3_Other_Text_COMM.Visible = False
End If
End If
End If
End If
End If
End If
End If
End If
End Sub