I am writing the following coded in the VB Editor of MS Access 2010
Code:Sub TestErrRaise2(intValue1 As Integer, intValue2 As Integer) On Error GoTo HandleError Dim intResult As Integer If intValue2 <> 0 Then ' calculate result by dividing first value by second value intResult = intValue1 / IintResult2 ElseIf intValue2 = 0 Then ' raise a custom divide by 0 error Err.Raise vbOjectError + 513, "TestErrRaise", _ "The second value cannot be a 0." End If Exit Sub HandleError: MsgBox "An error has occurred in your application: " & Err.Description Exit Sub End Sub
This is just variation on some code I found in a tutorial.
Now when I try to run it I get
"compile error expected =".
What is wrong?
Any help appreciated. Thanks in advance.
Respectfully,
Lou Reed