*Please* don't use the check boxes, Keith. :-(
As you realized, they are not queryable (i.e. unnormalized.)
The tables you have a good, but here's some other possibilities to consider:
a) Is it possible that employees may be asked to complete this survey
periodically (annually? on entry and exit?) If so, you need another
tblSurveyTaken table between tblUsers and tblAnswers. The EmployeeNumber
moves into this table, so fields are:
SurveyTakenID (PK)
EmployeeNumber (FK)
SurveyDate (Date/Time)
Now you have a main form for selecting the employee who completed the
survey, with a subform for their responses. In the AfterInsert event of this
form, you can execute an Append query statement to append all the questions
in the survey to tblAnswers, using the SurveyTakenID as the foreign key. Now
completing the survey is just a matter of running down the continuous
form/datasheet to give the answer to each question.
b) Could there be other questionnaires developed over time?
If so that might require a Survey table that defines the questions in this
questionnaire.
c) Any chance there will ever be a question that needs more than a yes/no?
Multiple choice? "Other" that requires a comment? If so, there's a sample
database by Duane Hookom here:
http://www.rogersaccesslibrary.com/Otherdownload.asp?SampleName='At%20Your%20Survey%2 02000'
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Keith Wilby" <he**@there.comwrote in message
news:45**********@glkas0286.greenlnk.net...
I'm putting together a PC Workstation Assessment application, the idea
being dead simple - there are a number of predetermined questions for the
user to answer either "yes" or "no" to. My first stab, also dead simple,
is just a flat table with the user's details and a Y/N field for each
question to contain their responses. The questions themselves are not
stored but just displayed on a form next to the relevant check box for
their response.
It works but of course I can't report against failing items because the
questions aren't stored. This leaves me wondering what the best table
structure might be to store the actual questions (this is always the
hardest part of a design for me). Here's my first idea:
tblUsers:
EmployeeNumber (PK)
Name
Location
... etc
tblAnswers:
EmployeeNumber (FK)
QuestionNo (FK)
Response
tblQuestions:
QuestionNo (PK)
QuestionText
I think it's obvious where the joins are but of course I'd have to code
the app to populate tblAnswers with a set of question numbers for each
user ... wouldn't I? I think I need some fresh ideas having stared at
this for quite a while now, any comment and suggestions greatly
appreciated.
Regards,
Keith.