Results 1 to 8 of 8
  1. #1
    raphael99 is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    13

    Table with IDCustomer and different primary key

    Hi, I'm novice and trying to undeerstand.


    I got a product table that I want to link with Customer Table.
    To relate one to many I have a IDCustomer on my product table that is about 1000 rows.
    I can link and all is working.
    But in the product table I need a Primary Key that is shorteer in rows (only 15 rows) and access won't let me create such a primary key because it contains null value.
    How to solve this problem.
    I Need Product ID (as primary key) to relate to another table which I will name Product details.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    You can't have a null product. You can't sell nothing. Delete the nulls then key the product field.
    #Rows are irrelevant.

  3. #3
    raphael99 is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    13
    Quote Originally Posted by ranman256 View Post
    You can't have a null product. You can't sell nothing. Delete the nulls then key the product field.
    #Rows are irrelevant.
    If I try to have as a Primary key the shorter column (15 rows) than the IDCustomers (1000 rows) access won't permit me because it contains null value.
    I have set numeric and it is numbered from 1 to 15. After that 15 there is nothing (is that null value?)
    Access does not permit me to have it a PK
    Please be more clear

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    Please step back and tell us about the process(es) involved. You mention Customer and Product. However, in a typical business situation you have:
    Customers who make 1 or more Orders
    An Order that may have 1 or many Detail lines (purchases)
    Each detail line represents a Product, Quantity and a SellingPrice.

    In some businesses a Product may be a single "thing", or it could be a "composite thing" made up of many assemblies/sub products.

    Please give us the business description so readers understand WHAT you are dealing with. Don't assume we know you business details.

  5. #5
    raphael99 is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    13
    Ok.
    I have a table Patient with idAnagrafica as primary key. (100 patients numbered fromn1 to 1000)
    I have a table Performance . This one is relate to IDAnagrafica (ihave made a copy and paste of IdAnagrafica from table Patient. The relation is one to many.

    In table performace I want to have an IDPerformance. Performance must be numbered from 1 to 15. IDPerformance must have Primary key.
    When I try to Made this one IDPerformance primary key access won't let me do. Because it does not contains a null value.
    It not contains null value in fact it is numbered from 1 to 15.
    How can I proceed?

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    I think you are telling us HOW. What would you tell someone you met in a McDonald's line who you did not know; who did not know you nor database; and asked you what are you trying to do? Simple terms- plain English.
    Here is a link to some business facts re Inventory that may give you an idea of the type of info I'm requesting.

  7. #7
    raphael99 is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    13

    Thumbs up

    Quote Originally Posted by orange View Post
    I think you are telling us HOW. What would you tell someone you met in a McDonald's line who you did not know; who did not know you nor database; and asked you what are you trying to do? Simple terms- plain English.
    Here is a link to some business facts re Inventory that may give you an idea of the type of info I'm requesting.
    @Orange.
    Sorry for bother. I'm newbie and also not english mother tongue.
    I think I have solved my case looking at this tutorial on tube: https://www.youtube.com/watch?v=4eSbFsUHUxs
    Thanks anyway for your suggeestion. Have to take a look on a lot of subject.

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    It is not a bother -- just trying to understand the issue before offering any suggestion/advice.

    As I have mentioned to others whose mother tongue is not English:
    Compose your message in your mother tongue, then go to google translate to get an English version. It may not be perfect, but it can be a great starting point.

    Glad you have found a solution.

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

Similar Threads

  1. Replies: 2
    Last Post: 10-10-2014, 05:33 AM
  2. Replies: 3
    Last Post: 04-09-2014, 12:48 PM
  3. Replies: 8
    Last Post: 03-22-2012, 08:48 AM
  4. Replies: 1
    Last Post: 08-11-2011, 09:22 PM
  5. table relations & primary key
    By mwabbe in forum Access
    Replies: 9
    Last Post: 08-19-2010, 10:09 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