Martynwheeler
Member
- Local time
- Today, 20:04
- Joined
- Jan 19, 2024
- Messages
- 82
Hi,
I have a database of questions. I would like to display 5 randomly selected questions from a category on a form to display to the user (in fact this would be displayed on the whiteboard to a class). Here is the sql that I am using:
I would like each question to be displayed in a textbox on the form. However, I would like to be able to use a checkbox next to the question to toggle the answer into the same textbox.
If I use the above query on a continuous form I can't toggle the answer of individual questions (the toggle acts on all of the questions and displays all of them as answers).
My thought was if I could assign a number 1, 2, 3, 4, 5 to each of the 5 questions in the query, I could then use a crosstab to produce a defined set of textboxes with associated checkboxes.
I cannot figure out how to produce a row number for the query? I tried the approach on this thread (https://599cd.com/tips/access/140703-row-number/) but it did not work.
I have attached the tables and queries that I have made so far.
thanks
Martyn
I have a database of questions. I would like to display 5 randomly selected questions from a category on a form to display to the user (in fact this would be displayed on the whiteboard to a class). Here is the sql that I am using:
Code:
SELECT TOP 5 tblQuestion.questionID, tblQuestion.questionText, tblQuestion.questionAnswer, tblQuestion.ShowAnswer
FROM tblQuestion
WHERE (((tblQuestion.CategoryID)<=5))
ORDER BY Rnd([questionID]);
I would like each question to be displayed in a textbox on the form. However, I would like to be able to use a checkbox next to the question to toggle the answer into the same textbox.
If I use the above query on a continuous form I can't toggle the answer of individual questions (the toggle acts on all of the questions and displays all of them as answers).
My thought was if I could assign a number 1, 2, 3, 4, 5 to each of the 5 questions in the query, I could then use a crosstab to produce a defined set of textboxes with associated checkboxes.
I cannot figure out how to produce a row number for the query? I tried the approach on this thread (https://599cd.com/tips/access/140703-row-number/) but it did not work.
I have attached the tables and queries that I have made so far.
thanks
Martyn