Monday 7 October 2013

Creating Result Using Check Box & Option Button

  Here are the codes -

Private Sub Command1_Click()
Dim roll, m1, m2, t, p As Integer
roll = Val(Text1.Text)
m1 = Val(Text2.Text)
m2 = Val(Text3.Text)
t = m1 + m2
Text4.Text = t
If Option1.Value = True Then
p = t * 100 / 250
ElseIf Option2.Value = True Then
p = t * 100 / 200
End If
If Check1.Value = 1 Then
p = p + 2
End If
Text5.Text = p
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text4.Enabled = False
Text5.Enabled = False
End Sub
Private Sub Command3_Click()
Form1.Show
Form2.Hide
End Sub

 Design of form :-

No comments:

Post a Comment