|
-
Jul 19th, 2009, 06:27 PM
#1
Thread Starter
Member
VB in Powerpoint, Expected Function or Variable
I'm trying to write a bit of code to work as a power point based test. When the user clicks on a radio button, the program would check to see if the correct one has been selected, then if correct answer has been selected add one to the score.
Here's the code:
Code:
Public TotalScore As Integer
Public Correct As Boolean
Public Sub OptionButton1_Click()
Correct = False
Run Answered()
End Sub
Public Sub OptionButton2_Click()
Correct = False
Run Answered()
End Sub
Public Sub OptionButton3_Click()
Correct = False
Run Answered()
End Sub
Public Sub Answered()
If (Correct = True) Then
TotalScore = TotalScore + 1
End If
End Sub
The problem comes up when the user clicks on one of the radio buttons it gives an error of "Compile Error: Expected Function or Variable".
Example: If the user clicks on OptionButton1, then the compile error pops up at Public Sub OptionButton1_Click(), so before any of the code has run.
I've not coded in Powerpoint before, and I'm not sure where this problem might come up at. Any idea's?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|