Can someone help me with this error. I am getting the error "Runtime error 13 Type mismatch". I am using the following code to get an average (being called from a button)...
Any help or suggestion is welcome! thanks in advance
Paul
Code:
Private Sub Command85_Click()
Dim i, numQ, total, avg As Single
Dim question As String
numQ = 0
total = 0
For i = 1 To 15
question = "question" & i
If Not IsNull(Me(question)) Then
numQ = numQ + 1
total = total + Me(question)
End If
Next i
avg = total / numQ
Me!average = avg
End Sub
Any help or suggestion is welcome! thanks in advance
Paul