I am in the beginning stages of remaking a database app that I use. The one I use now works but stoes all data in one table. granted that isnt the best way but I knew just enough to be dangerous <G>
I track repairs I do for customers. And right now, I redid my tables and broke it down to 3 tables. 1) Customer Data, 2) Customer Repairs, and 3) Customer Loaners.
What might happen on a typical day is a customer comes in and needs repair work done. I search for thier phone number. if I find it, my first form lists the customer info and thier past repairs. If not found, I enter their data and start a new repair.
If thier repairs take long or have to be shipped out, they will be issued a loaner.
Currently, I have relations set up as follows:
- from tblCustomer to tblEquipment. CustomerID (pk) in tblCustomer is tied to CustomerID (non-PK) in tblEquipment.
- from tblequipment to tblRepairs. txtESNDEC(non-pk) in tblEquipment is tied to txtESNDec (non-pk) in tblRepairs.
- from tblrepairs to tblLoaners. txtLoanerNumber (non-PK) in tblrepairs is tied to LoanerID (pk) in tblLoaners.
- from tblCustomer to tblLoaners. CustomerID (pk) in tblCustomers is tied to CustomerID (non-PK) in tblLoaners.
My goal is to tie everything together under the customer. The key is a customer may have 1 or more repairs, but each repair will have only one loaner, if at all.
Does the above look ok or should I make changes? I am no new to using relationships, that from everything I have read, its either I am doing too little, or making it too complicated.
My other thought would be to consolidate my tblEquipment and tblrepairs and just keep it in one table, tblrepairs. then my relationship would be:
- from tblCustomer to tblRepairs. customerID (PK) in tblCustomer is tied to customerID (non-pk) in tblRepairs.
- from tblrepairs to tblLoaners. txtLoanerNumber (non-PK) in tblrepairs is tied to LoanerID (pk) in tblLoaners.
- from tblCustomer to tblLoaners. CustomerID (pk) in tblCustomers is tied to CustomerID (non-PK) in tblLoaners.
Any insight or suggestion would be exptremely appreciated!
Richard
I track repairs I do for customers. And right now, I redid my tables and broke it down to 3 tables. 1) Customer Data, 2) Customer Repairs, and 3) Customer Loaners.
What might happen on a typical day is a customer comes in and needs repair work done. I search for thier phone number. if I find it, my first form lists the customer info and thier past repairs. If not found, I enter their data and start a new repair.
If thier repairs take long or have to be shipped out, they will be issued a loaner.
Currently, I have relations set up as follows:
- from tblCustomer to tblEquipment. CustomerID (pk) in tblCustomer is tied to CustomerID (non-PK) in tblEquipment.
- from tblequipment to tblRepairs. txtESNDEC(non-pk) in tblEquipment is tied to txtESNDec (non-pk) in tblRepairs.
- from tblrepairs to tblLoaners. txtLoanerNumber (non-PK) in tblrepairs is tied to LoanerID (pk) in tblLoaners.
- from tblCustomer to tblLoaners. CustomerID (pk) in tblCustomers is tied to CustomerID (non-PK) in tblLoaners.
My goal is to tie everything together under the customer. The key is a customer may have 1 or more repairs, but each repair will have only one loaner, if at all.
Does the above look ok or should I make changes? I am no new to using relationships, that from everything I have read, its either I am doing too little, or making it too complicated.
My other thought would be to consolidate my tblEquipment and tblrepairs and just keep it in one table, tblrepairs. then my relationship would be:
- from tblCustomer to tblRepairs. customerID (PK) in tblCustomer is tied to customerID (non-pk) in tblRepairs.
- from tblrepairs to tblLoaners. txtLoanerNumber (non-PK) in tblrepairs is tied to LoanerID (pk) in tblLoaners.
- from tblCustomer to tblLoaners. CustomerID (pk) in tblCustomers is tied to CustomerID (non-PK) in tblLoaners.
Any insight or suggestion would be exptremely appreciated!
Richard