Here's the code:
Dim a, b, r As Integer Dim opr As String Private Sub add_Click() a = Val(Text.Text) opr = "+" Text.Text = "" End Sub Private Sub clear_Click() Me.Text.Text = " " End Sub Private Sub divide_Click() a = Val(Text.Text) opr = "/" Text.Text = "" End Sub Private Sub equals_Click() b = Val(Text.Text) Select Case opr Case "+": Text.Text = a + b Case "-": Text.Text = a - b Case "*": Text.Text = a * b Case "/": Text.Text = a / b End Select End Sub Private Sub Form_Load() End Sub Private Sub multiply_Click() a = Val(Text.Text) opr = "*" Text.Text = "" End Sub Private Sub subtract_Click() a = Val(Text.Text) opr = "-" Text.Text = "" End Sub