M
mrodwell
Hi all, please find my code below....when i click on my Next button it
tells me variable not dounf and highlights the answer part....i don't
understand why this has happened...please could someone help.
rivate Sub nxtbut_Click()
Selection.TypeText datetxt
Selection.MoveRight Unit:=wdCell
Selection.TypeText wktxt
Selection.MoveDown Unit:=wdCell
Selection.MoveLeft Unit:=wdCell
'Training selection'
nSel1 = -int1 * 1 - Ext1 * 2 - Del1 * 3 - Rec1 * 4
With ActiveDocument.FormFields
Select Case nSel1
Case 1
.Item("Check9").CheckBox.Value = True
.Item("Check10").CheckBox.Value = False
.Item("Check11").CheckBox.Value = False
.Item("Check12").CheckBox.Value = False
Case 2
.Item("Check9").CheckBox.Value = False
.Item("Check10").CheckBox.Value = True
.Item("Check11").CheckBox.Value = False
.Item("Check12").CheckBox.Value = False
Case 3
.Item("Check9").CheckBox.Value = False
.Item("Check10").CheckBox.Value = False
.Item("Check11").CheckBox.Value = True
.Item("Check12").CheckBox.Value = False
Case 4
.Item("Check9").CheckBox.Value = False
.Item("Check10").CheckBox.Value = False
.Item("Check11").CheckBox.Value = False
.Item("Check12").CheckBox.Value = True
End Select
End With
'need to sort out tick boxes.
Q3bfrm.Hide
Unload Q3bfrm
Answer = MsgBox("Details of Training Courses?", vbYesNo + vbQuestion,
"Add another?")
If Answer = vbYes Then 'If Yes
Q3cfrm.Show 'Display dialog box again
Else
Selection.GoTo What:=wdGoToBookmark, Name:="b3date"
Q4frm.Show
Q3bfrm.Hide
Unload Q3bfrm
End If
End Sub
tells me variable not dounf and highlights the answer part....i don't
understand why this has happened...please could someone help.
rivate Sub nxtbut_Click()
Selection.TypeText datetxt
Selection.MoveRight Unit:=wdCell
Selection.TypeText wktxt
Selection.MoveDown Unit:=wdCell
Selection.MoveLeft Unit:=wdCell
'Training selection'
nSel1 = -int1 * 1 - Ext1 * 2 - Del1 * 3 - Rec1 * 4
With ActiveDocument.FormFields
Select Case nSel1
Case 1
.Item("Check9").CheckBox.Value = True
.Item("Check10").CheckBox.Value = False
.Item("Check11").CheckBox.Value = False
.Item("Check12").CheckBox.Value = False
Case 2
.Item("Check9").CheckBox.Value = False
.Item("Check10").CheckBox.Value = True
.Item("Check11").CheckBox.Value = False
.Item("Check12").CheckBox.Value = False
Case 3
.Item("Check9").CheckBox.Value = False
.Item("Check10").CheckBox.Value = False
.Item("Check11").CheckBox.Value = True
.Item("Check12").CheckBox.Value = False
Case 4
.Item("Check9").CheckBox.Value = False
.Item("Check10").CheckBox.Value = False
.Item("Check11").CheckBox.Value = False
.Item("Check12").CheckBox.Value = True
End Select
End With
'need to sort out tick boxes.
Q3bfrm.Hide
Unload Q3bfrm
Answer = MsgBox("Details of Training Courses?", vbYesNo + vbQuestion,
"Add another?")
If Answer = vbYes Then 'If Yes
Q3cfrm.Show 'Display dialog box again
Else
Selection.GoTo What:=wdGoToBookmark, Name:="b3date"
Q4frm.Show
Q3bfrm.Hide
Unload Q3bfrm
End If
End Sub