Results 1 to 3 of 3
  1. #1
    initiator is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2010
    Posts
    3

    Multiple records with same name BUT..

    Hi all,



    I have a fairly large access database of bank customers. The database is badly designed. It assigns different P. key's to the same customer. Say 'Customer ID' is the primary key and then the customer name. Bcz it's corporate customers so customer names are also unique. Here's the design

    ID CustomerName Amount Outstanding
    1001 XYZ Corp $10,000
    1002 XYZ Corp $20,000
    1003 XYZ Corp $15,000

    ........................

    I want to assign the same P. Key to all instances of XYZ Corp. How can it be done?

    thanks

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    should there be multiple entries for each customer? If so, you cannot do that as it defeats the purpose of a primary key. If you want just one entry with largest outstanding balance, run a query for SELECT * and GROUP BY max of Amount Outstanding. also, if you have access to the table design, keep field names without spaces "Amount Outstanding" should be "AmountOutstanding"

  3. #3
    Datagopherdan is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Dec 2008
    Posts
    220
    Quote Originally Posted by initiator View Post
    Hi all,

    I have a fairly large access database of bank customers. The database is badly designed. It assigns different P. key's to the same customer. Say 'Customer ID' is the primary key and then the customer name. Bcz it's corporate customers so customer names are also unique. Here's the design

    ID CustomerName Amount Outstanding
    1001 XYZ Corp $10,000
    1002 XYZ Corp $20,000
    1003 XYZ Corp $15,000

    ........................

    I want to assign the same P. Key to all instances of XYZ Corp. How can it be done?

    thanks
    Badly designed database? I've had my fair share of those. I can tell you from experience that the majority of the time you are better off creating a brand new database that is setup correctly and normalized then trying to band-aid something together that is wrong. Applying temporary fixes to a badly designed database is an ongoing process because theres always something that needs to be corrected to function right whereas if you take the time to plan it out and determine how everything should be setup, it will save you lots of time and headaches in the long run and you can count on your reporting being accurate instead of having to second guess everything.

    Dan
    Access Development

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Search for multiple records
    By Blake in forum Queries
    Replies: 1
    Last Post: 08-23-2013, 03:17 AM
  2. Replies: 1
    Last Post: 12-10-2009, 08:41 PM
  3. Saving records in multiple sub forms
    By niak32 in forum Forms
    Replies: 0
    Last Post: 10-13-2008, 04:24 AM
  4. Linking Multiple records
    By rricci@marcct.org in forum Programming
    Replies: 0
    Last Post: 02-14-2008, 09:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums