Hi All,
I have created a program for calculating average of 4 numbers, however, Im getting an error as "Run Time Error 13 Type Mismatch" on the Click event of "Calculate Average" command button.
The code written for the Click Event of "Calculate Average" command button goes as :
Private Sub cmd_avg_Click()
Dim num1 As Integer
Dim num2 As Integer
Dim num3 As Integer
Dim num4 As Integer
Dim avg As Integer
Dim msg As String
avg = txt_avg.Text // Line causing the error message //
num1 = txt_num1.Text
num2 = txt_num2.Text
num3 = txt_num3.Text
num4 = txt_num4.Text
avg = (num1 + num2 + num3 + num4) / 4
msg = "The average of four given numbers is " + avg
txt_avg.Text = msg
End Sub
Any help will be greatly appreciated, thanks