I am getting this error when I am trying to execute cal program compile error expected function or variable

Option Explicit
Dim Oper1 As Double, Oper2 As Double, Result As Double
Dim operator As String
Dim Cleardisp As Boolean
Private Sub clearBttn_Click()
Text1.Text = ""
End Sub
Private Sub digits_Click(Index As Integer)
Text1.Text = Text1.Text & Index
End Sub
Private Sub Division_Click()
Oper1 = Val(Text1.Text)
operator = "/"
Text1.Text = ""
Equals.Enabled = True
End Sub
Private Sub dotBttn_Click()
If Cleardisp = True Then
Text1.Text = ""
Cleardisp = False
End If
If InStr(Text1.Text, ".") Then
Exit Sub
Else
Text1.Text = Text1.Text + "."
End If
End Sub
Private Sub Equals_Click()
On Error GoTo Errormsg
Oper2 = Val(Text1.Text)
If operator = "+" Then Result = Sum(Oper1, Oper2)
If operator = "-" Then Result = Diff(Oper1, Oper2)
If operator = "*" Then Result = Product(Oper1, Oper2)
If operator = "/" Then Result = Div(Oper1, Oper2)
Text1.Text = Result
Cleardisp = True
Equals.Enabled = False
Exit Sub
Errormsg:
MsgBox "The Operation Result In The Error:" & Err.Description
Text1.Text = "ERROR"
Cleardisp = True
End Sub
Private Sub Form_Load()
Equals.Enabled = False
End Sub
Private Sub Minus_Click()
Oper1 = Val(Text1.Text)
operator = "-"
Text1.Text = ""
Equals.Enabled = True
End Sub
Private Sub Multiply_Click()
Oper1 = Val(Text1.Text)
operator = "*"
Text1.Text = ""
Equals.Enabled = True
End Sub
Private Sub Plus_Click()
Oper1 = Val(Text1.Text)
operator = "+"
Text1.Text = ""
Equals.Enabled = True
End Sub
Private Sub Sum(x As Double, y As Double)
Sum = x + y
End Sub
Private Sub Product(x As Double, y As Double)
Product = x * y
End Sub
Private Sub Diff(x As Double, y As Double)
Diff = x - y
End Sub
Private Sub Div(x As Double, y As Double)
Div = x / y
End Sub

hi
you havnt assign event handler for button e.g.
Private Sub Plus_Click() handles Plus.Click
Oper1 = Val(Text1.Text)
operator = "+"
Text1.Text = ""
Equals.Enabled = True
End Sub
Private Sub Minus_Click() handles Minus.Click
Oper1 = Val(Text1.Text)
operator = "-"
Text1.Text = ""
Equals.Enabled = True
End Sub
Private Sub Multiply_Click() handles Multiply.Click
Oper1 = Val(Text1.Text)
operator = "*"
Text1.Text = ""
Equals.Enabled = True
End Sub
Shridhar J Joshi Thanks a lot

Similar Messages

Maybe you are looking for

  • Change the recording level for recording with Thunderbolt-Firewire-Mixer

    Hey, I just bought a PHONIC Helix Board 24 Universal for recording some music via Firewire. Because my IMac has no Firewire-slot, I am using a Thunderbolt-Firewire-Adapter and a Firewire 400-800 cable. If I try to record some music it sounds really h

  • Order w/out any line item

    D/f, User is able to save the sales order without any line item. We want to stop it. So we maintained item (Field: MATNR) in the incompletion log @ item level, but still user is able to save the order w/out line item. So how to achieve this? Is there

  • Generic delta problem : in init load, the request is in yellow.......

    Hi all, I have created a table in R/3, and created a Generic data source using this table, and coming to deltas, i have selected Numeric pointer in which I have given the sales document number which comes from the table as the Delta relevant field. A

  • Issues with substitution

    Hi Gurus, Our substitution does not work even though all necessary pre-steps were done, such as importing the substitutions, bounce. But the original VO is still being used. Are there any issues with the substitution mechanism. Thanks for your advise

  • Need to count character from an xml

    Hi all, I need to count character from a field. and store it in a variable. My datasource is from xml file. Any ideas for the syntax? thanks in advance, Paolyn