Thanks John, I'll just have to do this the long way; the OR is what didn't
come to my mind. Maybe I don't understand normalization as well as I thought
I did. I used the model from test given by publishers to faculty for use in
their classes. The tests we are having are a wild mix of questions and
answer options. There are 13 different tests, and each test has anything
from 4 - 17 questions that have either a multiple choice (anything from abc
through a....j (which makes possibly 10 options) or a T/F option as an
answer, in short anything from 2 through 10 options. This gives me possibly
about 150 questions that have endless possibilities for answers.
I didn't design the tests (and I think this is poor test design), but I have
to accept what our nursing management had created. I first thought one
table per questionnair which seemed clumsy but in hindsight may have fixed
my problem. So I created one table with staff ID and test number and a Test
ID (unique Autonumber), Test Date and time, and then Q1 - 17 (17 being the
maximum). All questionnairs are saved to the one table, with 5 - 17 left
blank if the test has only 4 questions. Obviously, test demographics and
staff demographics come from linked tables once I get ready for reporting.
I score each test via an individual query because most tests have different
pass limits, usually around 80% - using simple IIf statements in the query.
Then I have a Union query that collects all scores and is the basis for a
query that runs the result report which may look like this:
Staff Name, Job Description, Ward (in the name header)
Detail section:
Test Date Test Name Score Pass/Fail
Recertification Due Date (usually one year from the last pass date)
1/1/05 Fire Drill 6 Fail
1/3/05 Fire Drill 9 Pass
1/3/06
1/2/05 Pain Management 8 Pass 1/2/06
2/5/05 IV Test 3 Fail
2/7/05 IV Test 6 Pass
2/7/06
This allows each user to check their scores immediately and repeat the test
if needed until they pass
I also pull reports for their supervisors that
show the test history and recertification dates for their individual staff.
Anyway, if it's not too complex, how could I have normalized this test to
accomodate all these endless possibilities. As I said, I used the model from
textbook publishers.
Thanks for further input; I know I have a lot to learn (and I do this only
on an as needed basis and not as my main job).
Brigitte
categories.
I
Well, it has a different number assigned to each checkbox (or other
control, buttons for example) in it. Whichever checkbox the user
selects, that number is stored in the single numeric field. Since a
numeric field can only store one number, only one box can be checked.
The C# code (or whatever it is) behind the action of the control is
sort of irrelevant!
(either
a,
b, c - which are the lables attached to the option field, or True False),
that is, don't let them leave the form without having all questions
completed.
I did this originally on table level by setting required to yes, but then
tests showed up with less questions which ruins what I had planned.
SO you are still using one FIELD per question... and paying the price
(in complexity of the programming you must do) for using
non-normalized data structures.
Therefore, I tried to set the validation rule for each quesiton and that
doesn't work for option groups and also not for individual checkboxes
(because they would lose the mutual exclusive capability). I tried If
[optiongroupxx] is Null Then MsgBox ..... but this doesn't work either
because the display is obviously not Null. So the question: Is there a way I
can force the user to complete all quesitons by selecting an answer from
each option group?
What you'll need to do is put code in the *FORM'S* BeforeUpdate event:
e.g.
Private Sub Form_BeforeUpdate(Cancel as Integer)
If IsNull(Me!optQuestion1) _
Or IsNull(Me!optQuestion2) _
Or IsNull(Me!optQuestion3) _
<etc>
Then
MsgBox "Please fill out all questions"
Cancel = True
End If
Just be sure that none of the Option Groups have a Default property
set, and that the table fields to which they are bound likewise have
the (annoying!!!) "default default" of 0 removed.
John W. Vinson[MVP]