Share via

Build A Survey Database In Access

Anonymous
2014-09-17T16:01:31+00:00

I have been asked to build an Access database that mainly encompassess entering in surveys. I have taken a stab at this myself but have came accross some problems. My main goal with building this database is efficiency for the individuals entering in surveys as well as speed of the database as well. Here is a very basic overview of how I want it to look and what I need your help with is how to set up the tables and forms.

First I have a master table that captures demographic information (unique patientID, name, address, consent date, etc). I'll note that these patients fill out a survey in paper form and my team will enter in their answers into Access

The one large survey that the patient fills out is actually 3 different surveys in 1. For simplicity sake say these 3 surveys have 3 questions each, so the one large survey has 9 questions. Each question has a response option of 1,2,3, or 4. My thought would be to have 3 tables and I visioned the design of each table to look like this (Pat_ID and RoundNumber would be the primary key):

Pat_ID
RoundNumber
SurveyDT
Q1
Q2
Q3

Which then a few examples of rows would look like this

Pat_ID Round Number SurveyDT Q1 Q2 Q3
10 0 9/17/2014 1 2 3
11 0 9/18/2014 2 3 4
12 0 9/19/2014 3 4 4

Now I want to note that the analysis of these surveys will be done in a different software. The database is mainly going to be used for storing the data.

In regards to the form (the survey, not the masterfile) I would like it set up just as it is in paper form. So they would enter in the patients ID and round, then type 1,2,3, or 4 for each of the 9 questions (no drop downs or look-ups please) Can I set up a form such that I only need to enter in Patient ID and round once and then enter in the results of the survey and then it will be conveniently stored in their respective tables?

That is what I have to start with, let me know if I am going at this the wrong way. Thanks

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

13 answers

Sort by: Most helpful
  1. ScottGem 68,810 Reputation points Volunteer Moderator
    2014-09-18T11:39:48+00:00

    A survey database has a very specific structure and you are not using it. Using fields to stand for each question is not correct or normalized.

    The proper structure is:

    tblQuestions

    QuestionID (Primary Key Autonumber)

    Question

    GroupID (Foreign Key)

    tblRespondent

    RespondentID (PK Autonumber)

    FiratName

    LastName

    Other info about respondent (your patient)

    tblResponse

    ResponseID (PK Autonumber)

    RespondentID (FK)

    ResponseDate

    tblAnswers

    AnswerID (PK Autonumber)

    ResponseID (FK)

    QuestionID (FK)

    Answer

    The general data entry structure is a main form bound to tblResponse where the user selects the respondent etc. and a subform with a record for each question and its answer.

    2 people found this answer helpful.
    0 comments No comments
  2. ScottGem 68,810 Reputation points Volunteer Moderator
    2016-05-07T12:39:58+00:00

    I don't believe Ken does contract work anymore, but I do. You can contact me through my website (listed in my profile) or my blog (listed below). 

    Or you can just ask questions in this forum. If you do, please start a new question to do so. Use the Participate link above to start a new question.

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2014-09-17T22:50:12+00:00

    The best way to achieve a form layout like that would be to have a parent form, in single form view, based on a table structured along these lines:

    PatientSurveys

    ....Pat_ID  (FK)

    ....RoundNumber

    ....SurveyDt

    ....EnteredBy

    ....DateEntered

    And a  subform, in continuous forms view, based on a table structured along these lines:

    PatientSurveyResponses

    ....Pat_ID  (FK)

    ....RoundNumber (FK)

    ....SurveyID (FK)

    ....QuestionID  (FK)

    ....Answer

    The primary key of this table would be a composite one of the first four columns.  Of these Pat_ID and RoundNumber would be a composite foreign referencing what you say would be the composite primary key of PatientSurveys, and SurveyID and QuestionID would be a composite foreign key referencing the composite primary key of the following table:

    SurveyQuestions

    ....SurveyID (FK)

    ....QuestionID  (FK)

    The other referenced tables in the model would be Surveys, Questions and Patients.

    When a row is inserted into PatientSurveys in the parent form rows would automatically be inserted into PatientSurveyResponses by executing an 'append' query in the parent form's AfterInsert event procedure, followed by requerying the subform to show the newly inserted rows ready for the answers to be entered.

    What you don't do is have separate tables to represent the three surveys, or encode data as column headings by having columns Q1, Q2, Q3 etc.  As a design for a relational database that would be about as bad as it could get.  A fundamental principle of the database relational model is the Information Principle (Codd's Rule #1).  This requires that all data be stored as values at column positions in rows in tables, and in no other way.  A table structured in the way you describe would really be no more than a spreadsheet masquerading as a relational database table.  A correctly designed relational database table on the other hand models an entity type, with each column representing an attribute of the entity type.

    To achieve the output in a horizontal format with columns per question the best way to do this would be as a report based on a query joining PatientSurveys and PatientSurveyResponses, which returns distinct rows of all columns from PatientSurveys and SurveyID from PatientSurveyResponses.  Within this embed a multi-column subreport based on PatientSurveyResponses with across-then-down column layout.  Group the parent report by SurveyID and put the subreport in the group header, linked to the parent report on Pat_ID, RoundNumber and SurveyID.

    0 comments No comments
  4. Anonymous
    2014-09-17T21:54:21+00:00

    Thanks but this didn't seem to get to what I want. I'll just try to lay it out how I want and if someone could walk me through how to build it that would be great. I would like the form to look something like this (the second column is where you would enter in you data)

    Pat_ID
    RoundNumber
    SurveyDT
    Entered By
    Date Entered
    Q1
    Q2
    Q3
    Q4
    Q5
    Q6
    Q7
    Q8
    Q9

    And how I would like the tables to look is the following

    Table1

    Pat_ID Round Number SurveyDT Entered By Date Entered Q1 Q2 Q3

    Table2

    Pat_ID Round Number SurveyDT Entered By Date Entered Q4 Q5 Q6

    Table3

    Pat_ID Round Number SurveyDT Entered By Date Entered Q7 Q8 Q9

    Is there a way to enter in data once to a form and have it divvy up among their respective tables?

    0 comments No comments
  5. Anonymous
    2014-09-17T16:38:35+00:00

    Perhaps this will help...

    Survey Database by Duane Hookom

    http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=3

    0 comments No comments