View Single Post
  #4   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Calculating Options Buttons in Word 2000

You can get to the finishline by crawling, walking or running.

Need to learn how to crawl, then walk, before trying to run.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

wrote in message
oups.com...
I am building an evaluation form for work. There are seven
categories. In each category there are five ratings (1-5) and users
select a rating by clicking an option button. I'd like to calculate
the numeric total of all the selected option buttons at the bottom of
the form and I've tried to use the following code to do so:

Dim a, b, c, d, e, f, g As Long
Dim pScore As Long
With ThisDocument
Select Case True 'First group
Case .OptionButton1.Value
a = 5
Case .OptionButton2.Value
a = 4
Case .OptionButton3.Value
a = 3
Case .OptionButton4.Value
a = 2
Case .OptionButton5.Value
a = 1
Case Else
MsgBox "No selection in Group 1"
End Select
'this would be repeated for the other categories.
End With
End Sub

When finally running the code, however, I get the following error
msg... "Compile Error: Method or Data Member not found" and the
program highlights the words "OptionButton1" in the code. Can someone
help me understand what this means and how to fix it? Thanks very
much.