M
murphy
Guest
Hi im trying to create a database for my A level project in which a pupil will take a test through a visual basic/forms interface. If the answers correct then a 1 will be entered into the field for that question if wrong a 0. The problem is when i try to enter the vlaue into the field it comes up with errors!
Do i need to predefine the fields or what? Ive looked in loads of forums and books but cant find anything related. Am i totaly doing this the wrong way? is there an easier way? or do you know what im doing wrong? any help whatsoever would be great! thank you.
The code is shown below:
Private Sub txt1_Enter()
If txt1.Text = "1" Then
Forms![Frm_Test]![count sets 1] = 1
MsgBox "Lets answer the next question!"
Else
Forms![Frm_Test]![count sets 1] = 0
MsgBox "Lets answer the next question!"
End If
End Sub
The code is shown below:
Private Sub txt1_Enter()
If txt1.Text = "1" Then
Forms![Frm_Test]![count sets 1] = 1
MsgBox "Lets answer the next question!"
Else
Forms![Frm_Test]![count sets 1] = 0
MsgBox "Lets answer the next question!"
End If
End Sub