Double click on command1 button and write code in code window.

Private Sub command1_click()
Dim a, b, x As Integer
a = Val(Text1.Text)
b = Val(Text2.Text)
x = a + b
Label3 = "Sum of Two Number = " & x
End Sub

Close the code window and run the form to display output.

VBO 1.PNG

Advertisements