webcats2
This very similar to a "survey" database I designed. Instead of storing the answers on the borrower's table, it uses an answer table. I see this having two advantages...
- more flexible - can add or remove questions as required without making changes to the database design
- less tables
- greatly reduces the number of indexes (Access creates an index for any foreign key)
If you want it, here it is, amended for your requirements...
[blue]tblBorrower[/blue]
BorrowID - primary key, autonumber, could be other if required
LastName
FirstName
etc
[blue]tblLoan[/blue] - master file for specific loan
LoanNumber - primary key
BorrowID - foregin key to tblBorrow. Note: a customer can have more than one loan, many-to-one
MasterID - foreign key to tblMasterQuestion, one-to-one
BDate
BTerms
LoanOfficer - probably want to create a table for loan officers and link as a foreign key
etc
[blue]tblQuestion[/blue] - suppository of questions
QuestionID - primary key, autonumber
QuestionTxt - question
can also add...
[red]- hyperlink to external document[/red]
- owner of question (accountability type of thing)
- review date
- sort code
[red]- mandatory yes/no field if question has to be answered
- imporatance if you want to flag important and misc questions[/red]
[blue]tblProfileQuestion[/blue] - profile for a "grouping" of questions
ProfileQID - primary key, autonumber
ProfileSbGrpID - foreign key to tblSubGroup
QuestionID - foreign key to tblQuestion
LineNo - interger, used for sorting questions
Note: ProfileQID is the primary key, but a unique index for [red]ProfileSbGrpID[/red] + [red]QuestionID[/red] is used to ensure only one profile exists for question x subgroup.
can also add...
- revision date
[blue]tblSubGroup[/blue] - sub units for questions
ProfileSbGrpID - primary key, autonumber
SbGrpCode - sorting field / description of group
can also add...
- revision date
- owner of subgroup
- scope - when to use this subgroup of questions
- comments
Would cpature things such as credit check, employer check, etc
[blue]tblProfileSbGrp[/blue] - profile used to group subgroups to the master file
MasterID - primary key [red]MasterID[/red] + [red]ProfileSbGrpID[/red]
ProfileSbGrpID
LineNo - interger, sorting field, used to organize subgroups in sequence
can also add...
- revision date
- comments
[blue]tblMAsterQestion[/blue] - Master group for questionaire. You may only have one Master group for your situation, or you may decide to have more
MasterID - primary key, autonumber
MasterCode - sorting code, or text description
can also add...
- owner
- revision date
- scope - when to use this selection / set of questions, etc
- comments
Examples...
Car loan
Student loan
Mortage
[blue]tblAnswers[/blue] - capture answers from questions
AnswerID - primary key, autonumber
LoanId - foreign key to tblLoan
ProfileQID - foreign key to tblProfileQuestion
plus desired answer fields for questions...
- AnswerTxt - details for answer, either a text field, 255 character or memo
- AnswerYes - yes / no for successful answer
- AnserrNA - yes / no if the question is applicable
can also add...
- memo field for comments
- anwser date
I realize this may seem complicated, but it is more complicated than it actually is...
[blue]1) Determining questions[/blue]
1a) MasterQuestion table is used to create a super group.
For example...
- car loan
- mortgage
- student loan
1b) SubGroup table is used to group the questions into subgroups.
- employer check
- credit check
- co-signer check
1c) Questions to be asked
I have set up a many-to-many relationship for
MasterQeustion x SubGroup - uses table ProfileSbGrp
SubGroup x Question - uses table ProfileQuestion
In summary...
Master -> SubGroups -> Questions for each subgroup
These many-to-many relationships may make the design seem complicated. Just think of the big picture as you work your way through.
[blue]2) Determining questions to ask borrower[/blue]
2a) Loan table used to determine "MasterQuestion" or type of survey
Again
- car loan
- mortgage
etc
2b) Using the relationship...
Master -> SubGroups -> Questions for each subgroup
A blank question or survey sheet is generated
- each answer is linked directly to the loan table (one-to-many)
- each answer is linked indirectly to the question table (many-to-many via the tblProfileQuestion table)
- each answer is linked to subgroup table (one to one, this was for sorting purposes only; in my case your "loan officer" could be different for each survey question)
In summary...
Loan -> MasterQuestion
Loan -> Answer
Answer -> ProfileQestion -> Question
Answer -> Question subgroup
Again, to get around the complexity, just remember the big picture...
- You need to know what type of suervey to ask (Loan -> Master)
- You need to tie your answers to the loan (Loan -> Answer)
- The answer is linked to the question
Bonus:
Since the question record can be linked to an external document, it give you access to an external form, or instructions or procedures for the question.
[blue]3) Answer questions[/blue]
The questions needed to be asked were created in step 2
Now the answers are created...
- text field cpatures text
- true/false or yes/no field caputers success or failure
- additional true/false flags the question if not applicable
This component is fairly straight forward in terms of relationships.
But, you need logic to flag your loans - accepted, researcing etc. Which means you have to
- Count the acceptable answers,
- Exclude tne N/A questions
- Red flag mandatory or important questions that failed
There is one gotcha...
A question should never or edited in the event it was used in an earlier loan questionaire. Rather, it would be advisable to create a new question. In the profile table delete the tblProfileSbGrp, the table used to associate a question to link the profile to a new question. This is why the tblProfileQuestion has two apparent primary keys (only one, ProfileQID, but the [red]ProfileSbGrpID + QuestionID [/red] is also unique -- it allows the integrity of old data to be preservered but to work with new data.)
Please note
- I have indicated loan officer and owner references in the tables. In my field, ownership of questions is really important so I have allowed this info to be tracked. For my database, these are linked using a foreign key to a Loan Officer table
- Ditto for revision dates on questions, profiles, etc
Did I loose you??
Richard