R
Red via AccessMonster.com
Hi everyone,
I have what I thought would be an easy fix, but I'm missing it. What I have
is a questionair form that is answered by either a yes or no answer then go
to the next question. If I answer no to the first question, no to the next
question then using the previous question button go back to first question,
then click on the next button, my first answer changes to yes (instead of
staying no). What I think I need is a Me.refresh or perhaps a Me.requery in
my code but I cant seem to make it work. I have included my code for your
reference. If anyone can see where I'm going wrong with this, I would be
greatful.
VR,
Red
Private Sub Command22_Click()
On Error GoTo Err_Command22_Click
' wont let the user move to the next record
If IsNull(Me.FrmnormRecordEntry!AnswerID) Then
MsgBox "Please answer question before going to next question."
DoCmd.CancelEvent
Exit Sub
End If
'question has sub questions if answered "yes" The acGoTo number must be
changed if number of questions are changed.
If Me!QuestionID = 708 And Me!FrmAnswerNorm!AnswerID = 1742 Then
DoCmd.GoToRecord , , acGoTo, 5
End If
'question has sub questions if answered "yes" The acGoTo number must be
changed if number of questions are changed.
If Me!QuestionID = 785 And Me!FrmAnswerNorm!AnswerID = 2064 Then
DoCmd.GoToRecord , , acGoTo, 10
End If
DoCmd.GoToRecord , , acNext
Exit_Command22_Click:
Exit Sub
Err_Command22_Click:
MsgBox "You've Reached The End Of The Review"
Resume Exit_Command22_Click
End Sub
I have what I thought would be an easy fix, but I'm missing it. What I have
is a questionair form that is answered by either a yes or no answer then go
to the next question. If I answer no to the first question, no to the next
question then using the previous question button go back to first question,
then click on the next button, my first answer changes to yes (instead of
staying no). What I think I need is a Me.refresh or perhaps a Me.requery in
my code but I cant seem to make it work. I have included my code for your
reference. If anyone can see where I'm going wrong with this, I would be
greatful.
VR,
Red
Private Sub Command22_Click()
On Error GoTo Err_Command22_Click
' wont let the user move to the next record
If IsNull(Me.FrmnormRecordEntry!AnswerID) Then
MsgBox "Please answer question before going to next question."
DoCmd.CancelEvent
Exit Sub
End If
'question has sub questions if answered "yes" The acGoTo number must be
changed if number of questions are changed.
If Me!QuestionID = 708 And Me!FrmAnswerNorm!AnswerID = 1742 Then
DoCmd.GoToRecord , , acGoTo, 5
End If
'question has sub questions if answered "yes" The acGoTo number must be
changed if number of questions are changed.
If Me!QuestionID = 785 And Me!FrmAnswerNorm!AnswerID = 2064 Then
DoCmd.GoToRecord , , acGoTo, 10
End If
DoCmd.GoToRecord , , acNext
Exit_Command22_Click:
Exit Sub
Err_Command22_Click:
MsgBox "You've Reached The End Of The Review"
Resume Exit_Command22_Click
End Sub