Results 1 to 3 of 3
  1. #1
    Mabalasik is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2017
    Posts
    1

    Help of Designing Tables and Relations (Newbie)

    Hello to all!

    I'm Ronald and a newbie in MS Access. I am trying to create our stock management list cause currently we're just using excel spreadsheet to manage our products list. I'm just starting to create a database in access.

    My first table is ProductList with fields ProductCode(PK), ProductName, OrderClientType, TypeOfUse. This table will be seldom touched or manipulate.

    The second table is called BatchNumCode/Quantity consists of fields BatchID (my PK, set to auto increment), ProductCode (my FK), BatchNumCode and Quantity. This table will be updated from time to time as products come and go almost every 3 to 4 days only and a product can have 2 or 3 batch number codes.

    My question is, in table BatchNumCode/Quantity, ProductCode will be deleted and replaced by a new batch number very often. Would it be ok if i use a primary key with autonum/increment or ramdom considering that entries will be deleted and replaced from time to time ? And how will this affect in the long run.



    i attached here the table relation. thank you and sorry for my english.
    Attached Thumbnails Attached Thumbnails Relationship.jpg  

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    I don't think you should delete and add records.
    you should add new ones.,but if already exists add to the quantity.

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Welcome to the forum!

    My question is, in table BatchNumCode/Quantity, ProductCode will be deleted and replaced by a new batch number very often. Would it be ok if i use a primary key with autonum/increment or ramdom considering that entries will be deleted and replaced from time to time ? And how will this affect in the long run.
    First thing. Object names in Access should be only letters and numbers. No spaces, special characters (exception is the underscore) or punctuation.
    Having "BatchNumCode/Quantity" as a table name not a good name because of the slash. Better would be "BatchNumCodeQuantity" or "BatchNumCode_Quantity"
    Second, read this:
    Autonumbers--What they are NOT and What They Are
    http://www.utteraccess.com/wiki/index.php/Autonumbers

    So, yes, it is OK to have a PK field as an Autonumber type. Virtually all of my tables have an autonumber as the PK field.

    Would you explain more why the "ProductCode" will be deleted and replaced by a new batch number? Could you just change the batch number & quantity?

    Also I noticed there is not a date field in table "BatchNumCode/Quantity". Is a date important when adding/changing the "ProductCode" / "BatchNumCode" / "Quantity"?

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

Similar Threads

  1. Replies: 3
    Last Post: 06-02-2015, 06:48 PM
  2. Designing the tables and relations
    By Enzym in forum Database Design
    Replies: 5
    Last Post: 12-29-2014, 08:54 AM
  3. Replies: 7
    Last Post: 09-11-2014, 11:48 AM
  4. Relations tables
    By azhar2006 in forum Access
    Replies: 6
    Last Post: 08-03-2014, 02:29 PM
  5. Combining tables and keeping relations
    By Bangsadrengur in forum Access
    Replies: 7
    Last Post: 07-28-2011, 08:12 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