Updating a field when a criteria is true

Nitrous

Registered User.
Local time
Today, 00:21
Joined
Jan 23, 2003
Messages
16
Hi there,

Im currently working on a testing system for my school and have come up against a few problems.

The first one is giving marks for correct questions when a test is being taken.

I have the Question and 5 possible answers, and the user has to enter a number 1 to 5 to identify the correct answer, and the correct answer has already been input when the question was made.

What I want to do is to compare the input answer against the stored correct answer and if its correct to award 1 mark to the user, which needs to go in a field called Mark.

How do I do this using VBA?

The other problem I have is making a button passworded. I have an administrators log in button which, when clicked, I want to bring up an 'Enter Parameter' box and allow the admin to enter a password, if it is correct take them to the admin form, if not return the user to the main form.

Many Many thanks in advance!
 
Here is a sample database from Charityg...

As for the Password, you can use something like this:

Code:
Private Sub Form_Load()
Dim pw As Variant

If InputBox("What is the password?", "Password Protected") = "openme" Then
Docmd.OpenForm "AdminForm"
Else
Docmd.OpenForm "RegularForm"
End If

End Sub
 
jfgambit said:
Here is a sample database from Charityg...

As for the Password, you can use something like this:

Code:
Private Sub Form_Load()
Dim pw As Variant

If InputBox("What is the password?", "Password Protected") = "openme" Then
Docmd.OpenForm "AdminForm"
Else
Docmd.OpenForm "RegularForm"
End If

End Sub

works great!

Now just the mark thing to go... :S
 

Users who are viewing this thread

Back
Top Bottom