Composite Key

Swift_74d

Board Regular
Joined
Aug 19, 2009
Messages
148
Hey all,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
Just started to go back and review one of my first databases and correct allot of errors I made with the limited knowledge I had at the time.<o:p></o:p>
<o:p></o:p>
One of the biggest errors I made was not normalizing the data and, in an attempt to correct this error, I came across a table that got me kind of confused. This table ("Payments") doesn't have a Primary Key and I can't seem to find a composite key that would work.

Should i just add another field as an auto number to represent the primary key just to appease the rules, or are there exceptions to the rule and is this one of them? If anyone has any suggestions (table format is below) please let me know.<o:p></o:p>
<o:p></o:p>
The table is used to capture all payments made in respect to claims in the database in order to allow totals based on several different criteria.<o:p></o:p>
<o:p></o:p>
ID (Foreign Key)<o:p></o:p>
Month (In digit form)<o:p></o:p>
Year <o:p></o:p>
Payable to (Who the payment is going to)<o:p></o:p>
Amount<o:p></o:p>
Type of Payment (Handling / Settlement / General Payment)<o:p></o:p>
Company (Company Making the Payment)<o:p></o:p>
<o:p></o:p>
*Notes-<o:p></o:p>
Not the actual names of the fields just used plain words for ease of understanding.<o:p></o:p>
<o:p></o:p>
However improbable, it is possible for all fields in two records to be identical.<o:p></o:p>
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Not sure how using an AutoNumber would 'appease' the rules but it's probably the best option.

Using composite keys is hard enough at the best of times and from what I've seen of your setup so far nothing immediately stands out that could be used for one.

Perhaps there's something in the data you could use?
 
Upvote 0
Thing is, i don't neccesarily want to prevent duplicate entries. There are rare times where all fields will be identical and not be incorrect. Plus these reports are produced as support for an account only used in claim payments (ie if the balance this month is x, what payments were made to bring it to x?) so if there are errored entries they stand out and are easily corrected (currently have payment entry set up with sub form showing the claim payment table to easily sort and correct).

I guess now my next question would be why set up an auto number if all its there to do is create another field that's only purpose is to say that there's a primary key?
 
Upvote 0
I guess now my next question would be why set up an auto number if all its there to do is create another field that's only purpose is to say that there's a primary key?

Because if you ever migrate this to SQL Server then it will require a key. Other than that, there probably is no reason.
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,813
Members
452,945
Latest member
Bib195

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top