How To Create A Quiz Using Microsoft Access Database
To create a quiz in Microsoft Access, build linked tables for questions, answer choices and quiz attempts, then use a form to collect responses. A query can compare each saved response with the answer key and calculate a score. Start with a single-answer multiple-choice quiz.
Which licences fit your PC setup?
Prices are an AUD snapshot, not a live quote. Confirm variant and total on the listing.
-

Windows 11 Pro key
$14.99 AUD
$29.00 -

Office 2024 Pro Plus key
$20.00 AUD
$39.00 -

Windows 11 Home key
$18.88 AUD
$37.00
Choose a manageable first quiz
This walkthrough uses one fixed set of questions, one correct choice per question and equal marks. True-or-false questions fit the same design with two choices. Written answers need separate response fields and a marking process; add those after the basic quiz works.
Check that Microsoft Access is installed before starting. If you are identifying an older Office bundle, the guide to what comes with Microsoft Office Home and Student 2019 provides context, but check your own installation for Access.
You will use Table Design, relationships, forms and queries. A custom Start or Submit button also needs an embedded macro or VBA event procedure: drawing a button does not implement its behaviour.
Create tables that separate questions from responses
Create a blank database and save it with a descriptive name. Use Create, then Table Design, to build the following structure. Each table needs its own AutoNumber primary key.
| Table | Fields and data types | Purpose |
|---|---|---|
| Questions | QuestionID: AutoNumber; QuestionText: Long Text; SortOrder: Number | Stores question wording and display order. |
| Choices | ChoiceID: AutoNumber; QuestionID: Number; ChoiceText: Short Text; IsCorrect: Yes/No | Stores each question's available answers. |
| Attempts | AttemptID: AutoNumber; ParticipantName: Short Text; StartedAt and CompletedAt: Date/Time | Identifies each quiz sitting. |
| Responses | ResponseID: AutoNumber; AttemptID, QuestionID and SelectedChoiceID: Number | Records the selected answer for each question in an attempt. |
Set the Number fields that reference AutoNumber keys to Long Integer. Make question wording, choice text, Choices.QuestionID, Responses.AttemptID and Responses.QuestionID required. SelectedChoiceID can remain empty until the participant answers.
Keep the answer key in Choices.IsCorrect rather than duplicating it as answer text in Questions. For this design, validate that every question has exactly one correct choice.
Link the tables and prevent duplicate responses
- Open Database Tools, then Relationships, and add the four tables.
- Link Questions.QuestionID to Choices.QuestionID and Responses.QuestionID.
- Link Attempts.AttemptID to Responses.AttemptID, then Choices.ChoiceID to Responses.SelectedChoiceID.
- Enable referential integrity for each relationship. Check Microsoft's relationship instructions if Access rejects a link.
- In the Responses table's Indexes window, create a unique index containing AttemptID and QuestionID together. This prevents two responses to the same question within one attempt.
These relationships check that referenced records exist. They do not, by themselves, check that a selected choice belongs to the response's question. Add that validation to your answer-saving procedure.
Enter and check the question bank
- Add a small set of questions to Questions, assigning SortOrder values in the intended sequence.
- Add each question's choices to Choices using its QuestionID. Mark only the correct choice as IsCorrect.
- Check for missing choices, ambiguous wording and questions with no correct choice or several correct choices.
Use datasheet view for a small prototype. For a larger bank, import prepared data through External Data and check how imported question identifiers map to the database's keys before creating choice records.
Keep the question bank unchanged once you begin retaining real results. Changing answer keys can change scores calculated from earlier responses. Preserve a separate quiz version when revising questions.
Build a form that displays questions and collects answers
Create a form named QuizForm with Questions as its Record Source. Set Order By to SortOrder, QuestionID and enable Order By On Load. Display QuestionText in a bound text box with Locked set to Yes. Add a hidden bound text box named QuestionID for the current question's key.
- Add an unbound text box named txtAttemptID to hold the active attempt identifier. Your Start procedure must create an Attempts record and put its new AttemptID here before answers can be saved.
- Add an unbound combo box named cboAnswer. Set Row Source Type to Table/Query and build a row-source query containing Choices.ChoiceID and Choices.ChoiceText.
- Include Choices.QuestionID in that query as a hidden criterion field, using [Forms]![QuizForm]![QuestionID] as its criterion. Set Column Count to 2 and Bound Column to 1; hide the first display column so participants see answer wording while the control returns ChoiceID.
- Set Limit To List to Yes. In the form's Current event, requery the answer control and load the saved response for the current AttemptID and QuestionID, or clear the selection if none exists.
Microsoft's guide to adding list boxes and combo boxes explains row sources, bound columns and hidden columns.
Lock the question controls and disable additions and deletions on the participant form. Use a separate editing form to maintain the question bank.
Save answers before calculating the score
The unbound answer control does not save responses automatically. Implement the following sequence with macros or VBA, using button Click events and the answer control's After Update event as appropriate.
- Start an attempt: save the participant identifier and start time in Attempts, retain its AttemptID, and display the first question.
- Save an answer: confirm that the selected ChoiceID belongs to the current QuestionID. Insert a Responses record if none exists for this attempt and question; otherwise update the existing record.
- Navigate: save any pending selection before moving to the previous or next question. Reload that question's saved answer so revisiting it does not erase the response.
- Submit: save the final selection, check for unanswered questions, and either ask the participant to complete them or apply your stated rule for blanks. Record CompletedAt and prevent further edits through the form.
Calculate marks from saved responses rather than increasing a running total whenever an answer is clicked. Repeated clicks or changed answers must not add extra marks.
Create a score query
In Query Design, join Responses to Choices on SelectedChoiceID and ChoiceID. Filter by the active AttemptID. Add a calculated field: Mark: IIf([IsCorrect],1,0). Create a totals query over these results, grouping by AttemptID and summing Mark.
For this fixed quiz, the maximum score is the number of questions in Questions, including unanswered ones. Divide earned marks by that count and format the result as a percentage. Display zero when no response records exist, and prevent starting an empty quiz.
Test the quiz and prepare results
Run attempts with all correct answers, all incorrect answers, changed answers and unanswered questions. Check that separate attempts retain separate responses, navigation restores selections, and submitted attempts cannot be changed through the participant form.
Build a report from a query joining Attempts to the score totals. Keep all records from Attempts with a left join, and use Nz on missing score totals to display zero. Include the participant, completion date, earned marks and maximum marks. Filter the report to the intended attempt before printing or sharing.
For related tasks, browse the Microsoft Office guides. If you prepare a result sheet in Word and print it on a Mac, follow the instructions for printing single-sided in Microsoft Word for Mac.
Next, enter a small test question bank and complete one attempt, checking every saved response against the score query before adding the remaining questions.
Other editions for separate workloads
Other editions for separate workloads; prices in AUD, confirm the total on the listing.
-

Windows 10 Pro key
$12.00 AUD
$15.00 -

Microsoft 365 Pro Plus, 5 devices
$15.00 AUD
$29.00 -

Windows Server 2022 Standard
$120.00 AUD
$239.00
How to check this worked
- Open Settings, System, Activation and confirm the edition shown.
- Enter the key and run activation; expect a green tick within a minute.
- Reboot and re-check activation survives the restart.
FAQ
What else should you know before buying?
- What do I need before starting?
- Read the requirements and confirm the edition first; the steps assume the machine is compatible.
- How do I know the licence is genuine?
- Activate on Microsoft's servers and check Settings, System, Activation. A working activation is the test.
- Is this a subscription?
- Keys sold here are one-time lifetime licences. Microsoft 365 plans are billed by Microsoft instead.
- What if the key fails?
- Email hi@ms.codes with the order number and a screenshot. Replacement or refund applies within 30 days.
Check who prepared and reviewed this guide
- Written by
- MS.Codes editorial
- Reviewed by
- Support team
Last verified: (source review; see test status above).