FORM 1:-
Dim db As Database
Dim rs As Recordset
Private Sub Form_Load()
Set db = OpenDatabase("D:\johney vb\QUIZ\quiz\qa.mdb")
Set rs = db.OpenRecordset("r")
End Sub
Private Sub Image1_Click()
Unload Me
End Sub
Private Sub Image2_Click()
Form2.Show
End Sub
FORM 2:-
Dim db As Database
Dim rs As Recordset
Public r As String
Dim a As String
Dim res As Integer
Private Sub Command1_Click()
Timer1.Enabled = False
On Error GoTo ex
If rs.Fields(5) = a Then
res = res + 1
Label2.Caption = res
End If
rs.MoveNext
Label1.Caption = rs.Fields(0)
Option1.Caption = rs.Fields(1)
Option2.Caption = rs.Fields(2)
Option3.Caption = rs.Fields(3)
Option4.Caption = rs.Fields(4)
Option1.SetFocus
ex:
If Err.Number = 3021 Then
Form3.Show
Me.Hide
Form3.Text1.Text = res
End If
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Set db = OpenDatabase("D:\johney vb\QUIZ\quiz\qa.mdb")
Set rs = db.OpenRecordset("r")
rs.MoveFirst
Label1.Caption = rs.Fields(0)
Option1.Caption = rs.Fields(1)
Option2.Caption = rs.Fields(2)
Option3.Caption = rs.Fields(3)
Option4.Caption = rs.Fields(4)
End Sub
Private Sub Option1_GotFocus()
a = Option1.Caption
End Sub
Private Sub Option2_GotFocus()
a = Option2.Caption
End Sub
Private Sub Option3_GotFocus()
a = Option3.Caption
End Sub
Private Sub Option4_GotFocus()
a = Option4.Caption
End Sub
Private Sub Timer1_Timer()
On Error GoTo ex
Beep 1000, 250
If rs.Fields(5) = a Then
res = res + 1
Label2.Caption = res
End If
rs.MoveNext
Label1.Caption = rs.Fields(0)
Option1.Caption = rs.Fields(1)
Option2.Caption = rs.Fields(2)
Option3.Caption = rs.Fields(3)
Option4.Caption = rs.Fields(4)
Option1.SetFocus
ex:
If Err.Number = 3021 Then
Timer1.Enabled = False
Form3.Show
Form3.Text1.Text = res
Me.Hide
End If
End Sub
FORM 3:-
Private Sub Form_Load()X
End Sub
Private Sub Image1_Click()
End
End Sub
TEST MANAGER