Yes, I just spent 1h searching these forums. I think I now have an idea how to set up my tables. I currently have two questionnaires, but I want to set up a flexible structure which can accommodate more. I also need quite a lot of flexibility concerning the answers. My current database model looks like this:
tCustomers
- customerID (pk)
- Name
- Address
tControlTypes
- controlTypeID (pk)
- controlType (e.g. "RadioButton")
- controlText (e.g. "never")
tAnswerTypes
- answerTypeID (pk)
- answerType (e.g. "5RadioStyle1" or "Free Text")
tAnswerTypeControls
- answerTypeControlID (pk)
- answerTypeID (fk)
- controlTypeID (fk)
tQuestions
- questionID (pk)
- answerTypeID (fk)
- surveyType
- questionText
- explanationText
tResponses
- responseID (pk)
- customerID (fk)
- questionID (fk)
- date
- responseValue
I'm aware that this is still not fully normalized, surveyType could get its own table, for now I'd like to continue with the above structure. With the two questionnaires I currently have, the following answerTypes exist:
- RadioButtonsImportance (meaning a row of 5 buttons ranging from "unimportant" to "extremely important"
- freeText
- freeTextWithImportanceButtons (a combination of both above)
An example question for the last type would be:
- Which other features would you like to see included:
_____________________ o unimportant ... o extremely important
Now I'm wondering whether it's possible to automatically generate the forms? From an entry in the tQuestions table, it should be possible to automatically generate a form with question text, expanation text, and the proper answer controls? But how can I automatically bind these controls to the proper fields in the tResponses table? I suspect that the answer to this question is "the design of tResponses is not sophisticated enough"... but there are also some technical aspects to the VBA code I'd have to write which are unclear.
I'm aware that a full answer to this question is impossible, or at least way too long for a forum. I currently have the Viescas "Inside out" book, which was quite helpful for the first few steps, but is not useful when it comes to advanced database programming. Maybe the best answer I can get is a good book recommendation
. Btw, I'm working with Access 2003. I hear good things about the Access 2002 Developers Handbook set by Litwin, Getz and Gunderloy, but there's many other highly recommended books... which one has a heavy focus on VBA in Access?
Otherwise, feel free to discuss my design, and/or anything else you may find helpful.
tCustomers
- customerID (pk)
- Name
- Address
tControlTypes
- controlTypeID (pk)
- controlType (e.g. "RadioButton")
- controlText (e.g. "never")
tAnswerTypes
- answerTypeID (pk)
- answerType (e.g. "5RadioStyle1" or "Free Text")
tAnswerTypeControls
- answerTypeControlID (pk)
- answerTypeID (fk)
- controlTypeID (fk)
tQuestions
- questionID (pk)
- answerTypeID (fk)
- surveyType
- questionText
- explanationText
tResponses
- responseID (pk)
- customerID (fk)
- questionID (fk)
- date
- responseValue
I'm aware that this is still not fully normalized, surveyType could get its own table, for now I'd like to continue with the above structure. With the two questionnaires I currently have, the following answerTypes exist:
- RadioButtonsImportance (meaning a row of 5 buttons ranging from "unimportant" to "extremely important"
- freeText
- freeTextWithImportanceButtons (a combination of both above)
An example question for the last type would be:
- Which other features would you like to see included:
_____________________ o unimportant ... o extremely important
Now I'm wondering whether it's possible to automatically generate the forms? From an entry in the tQuestions table, it should be possible to automatically generate a form with question text, expanation text, and the proper answer controls? But how can I automatically bind these controls to the proper fields in the tResponses table? I suspect that the answer to this question is "the design of tResponses is not sophisticated enough"... but there are also some technical aspects to the VBA code I'd have to write which are unclear.
I'm aware that a full answer to this question is impossible, or at least way too long for a forum. I currently have the Viescas "Inside out" book, which was quite helpful for the first few steps, but is not useful when it comes to advanced database programming. Maybe the best answer I can get is a good book recommendation
Otherwise, feel free to discuss my design, and/or anything else you may find helpful.