Good day to everyone:) , i'm a new user here and i'm also new to Visual Basic , i'm having problems coding the codes myself. It's an assignment for me from school , after attemtping it for a few hours , I'm almost finish but i'm having trouble in the calculation for average , you see. I feel so tiny in this world when i get to know that there's still more for me to learn. Sorry for my long story but what i'm trying to say is that i hope to learn more. I'll show you guys the codes of mine now, i think this assignment is easy for you guys so i was hesitating at first to post or not but i posted anyway , anyone can teach me what to do? thank you so much for helping!:)
And I'm also having problem with the MsgBox where i need to write the code to notify me like " Please enter integers! " , the teacher would want to test on that availablity either it is present or not.
Oh boy...i feel so troublesome to keep on asking so much...
Codes :
Dim exam1 As Integer
Dim exam2 As Integer
Dim Average As Integer
Private Sub Command1_Click()
exam1 = Text1.Text
exam2 = Text2.Text
Average = Label5.Caption
Average = (exam1 + exam2) / 2
exam1 = (Text1.Text)
If IsNumeric(Text1.Text) Then
exam1 = Text1.Text
Else
MsgBox "Please enter integers!"
End If
exam2 = (Text2.Text)
If IsNumeric(Text2.Text) Then
exam1 = Text2.Text
Else
MsgBox "Please enter integers!"
End If
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Label5.Caption = ""
End Sub
Private Sub Command3_Click()
If MsgBox("Are you sure you want to quit?", vbYesNo + vbQuestion, "Confirmation") = vbYes Then
End
End If
End Sub
I wanted to post a picture of my interface but it kept on saying here that " failed to upload bmp "...
Thank you everyone for your help!