Lab 1: Student detait

Private Sub Command1_Click()
Text5.Text = ((Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text)) / 300) * 100

End Sub

Private Sub Command2_Click()
Select Case Val(Text5.Text)
Case 75 To 100
Text6.Text = "Distinction"
Case 60 To 74
Text6.Text = "First Division"
Case 50 To 59
Text6.Text = "Second Division"
Case Else
Text6.Text = "Pass Division"
End Select
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Form_Load()
Combo1.AddItem ("BCA")
Combo1.AddItem ("BBA")
Combo1.AddItem ("BBM")
Combo1.AddItem ("CS")
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii >= 65 And KeyAscii <= 90 Or KeyAscii >= 90 And KeyAscii <= 122 Or KeyAscii = 32 Or KeyAscii = 8 Then
Else
MsgBox ("Enter Alphabets only")
KeyAscii = 0
End If
End Sub


Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then
MsgBox ("Enter Number only")
KeyAscii = 0
Else
End If
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then
MsgBox ("Enter Number only")
KeyAscii = 0
Else
End If
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then
MsgBox ("Enter Number only")
KeyAscii = 0
Else
End If
End Sub



No comments

Powered by Blogger.