Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2004

Tip: Looking for answers? Try searching our database.

Answer box....where am i going wrong.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mrodwell - 30 Nov 2004 08:47 GMT
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
Ed - 30 Nov 2004 13:10 GMT
I don't see where you have any variables declared.  When I put your "Answer=
etc." into my module, it worked fine - after I declared a variable named
"Answer".

Ed

> 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
[quoted text clipped - 52 lines]
> End If
> End Sub

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.