![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Have you thought about using structure: tblCustomer *CustomerID *CustomerName etc tblReferral *ReferralID *CustomerID *ReferralSource tblReferralData *ReferralID *ReferralCondition *ReferralConditionData Basically, store all the Customer data in tblCustomer. Store the referral type in tblReferral (or you can push this up to tblCustomer if you are only ever going to track the Primary referral source). Store the conditional data in the tblReferralData. Set up a lookup table that has all the conditions for each type of referral so that when you get a new customer you can prepopulate tblReferralData with all the Questions that need to be answered. It may make data manipulation a little more difficult, but life will ultimately be easier when you identify a new referral method and/or new conditional data you need to collect for a given referral method. Tom |
#4
| |||
| |||
|
|
I can't figure out the best (normalized) way to represent the following data, despite the fact that it seems like a simple and frequent requirement. My current database holds Customer information. I need to track how customers have heard about us. Here are some of the ways: Credit Union Referral Credit Union General Web Word of Mouth Advertising Now, *beyond* that, I need to include conditional data. If it's a Credit Union Referral, I need to know which credit union, the loan officer, etc. If the Web, I need to know whether it came from our website, a search engine, etc. If Advertising, blah blah. This is what I don't know how to model. Thus far I have a [Customers] table and a [SourceTypes] table, related by a SourceTypeID field. That's all basic, and takes me up through the first part of my model. It's the conditional information that I don't know how to properly represent. I have ideas, but they don't seem to be normalized or I see serious problems down the road in manipulating the data. Any ideas? |
#5
| |||
| |||
|
#6
| |||
| |||
|
#7
| |||
| |||
|
#8
| |||
| |||
|
|
With one and only one SourceTypeID, I would structure as follows... tblCustomer *CustomerID *CustomerName *SourceType *etc tblReferralData *CutomerID *ReferralCondtion *ReferralData With an additional lookup table lkpReferral *SourceType *ReferralCondition When you add a new record to tblCustomer, your routine would include querying in all the ReferralConditions from lkpReferral fort the appropriate SourceType to tblReferralData and forcing the user to answer all the questions before the add routine is done. Example: Assume the following Conditionaldatais required for Credit Union referrals: *Credit Union Name *Referring Employee Name * Referring Employee Telephone Number Then if I am a new customer, and I heard about your service from a Credit Union, yourdataentrywould be tblCustomer *CustomerID - autonumber - 987 *CustomerName - Tom M~~~~ *CustomerStreetAddress 123 Anystreet *etc *SourceType - Credit Union The new record routine would include a query that would populate tblReferralData with the following 3 records: tbReferralData record 1 *CustomerID - 987 *ReferralCondtion - Credit Union Name *ReferralData - null record 2 *CustomerID - 987 *ReferralCondtion - Referring Employee Name *ReferralData - null record 3 *CustomerID - 987 *ReferralCondtion - Referring Employee Telephone Number *ReferralData - null Thedataentryperson would then be forced to enter values for all 3 of the nulls beforedataentryis complete. You can prevent nulls by requiring answers to the questions to complete the new record routine. If you really want to enforcedataintegrity, you could collect all this info in an unbound form, and have code to commit thedatato the table, that was you could enforce no nulls at the table level for ReferralData It may seem redundant to store the ReferralCondtion in tblReferralData when you could add an ID field to the lookup table, then just store the ID in tblReferralData - I don't like doing that because inevitably somebody well meaning or otherwise will get in and edit the lookup table and change an existing question instead of simply adding a new one. Then your entiredataset is messed up. You can also skip the part querying in the specific questions you want answered from the lookup table and simply provide a combobox with a recordset derived from the lookup table filtered to the applicable question. Thedataentryperson could then pick the one he wanted to answer. This is simpler than the method I originally described, but it lacks the ability to force thedataentryperson to answer the questions you want answered (i.e., they could just skip this part). This may seem like overkill on the setup, but when it comes time to analyze thedata, it will be a breeze. HTH Tom |
![]() |
| Thread Tools | |
| Display Modes | |
| |