Results 1 to 5 of 5
  1. #1
    ariansman is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Posts
    57

    how to make invoice number?

    I am selling some products, namely A to M. I record the orders of costumers in a table, named "orders". For example, if costumer "Jack" has ordered as the following:
    Code:
    ID   costumer     product     quantity  unitprice    orderdate
    
    
    12      jack         A            4        10        25/11/2014
    13      jack         B            5         5        25/11/2014
    14      jack         C            1         4        25/11/2014
    15      jack         F            3         2        25/11/2014
    16      Jack         G            4         8        25/11/2014
    17      Jack         H            1         7        25/11/2014

    Then I make a report based on the above table and issue that as the invoice to the costumer, who is jack here.
    How can I make a unique invoice number, which automatically increases sequentially for each invoice? Do I need to add a new column to the table? I also need to be able to look for a specific invoice based on the number, or date.
    Thank you

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,957
    Generating custom unique identifier is a common topic. For start review: https://www.accessforums.net/forms/a...ing-23329.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    A S MANN is offline Advanced System Analyst
    Windows XP Access 2007
    Join Date
    Oct 2010
    Location
    India
    Posts
    163
    The order table should have details of order with invoice no as primary key.
    The details shown above in table order should be in table Order_Details having 1 to many relationship with Table Order.
    You are facing this problem due to wrong table design.

  4. #4
    Demerit's Avatar
    Demerit is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Nov 2013
    Posts
    125
    Just like A S MANN said, your table structure is not good
    Create a table called: ORDERS
    ORDERS:
    OrderID PK
    customerID
    Orderdate



    ORDER_DETAILS
    ID PK
    orderid SK
    productId
    quantity
    unitprice

  5. #5
    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,742
    ariansman,

    See the links on this page to help you understand table design, keys, and relationships.


    Also you should advise readers that you have cross posted when you post the same/similar question on multiple sites.

    http://www.access-programmers.co.uk/...d.php?t=272788

    http://www.utteraccess.com/forum/ind...wtopic=2024854

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

Similar Threads

  1. Replies: 9
    Last Post: 06-25-2014, 01:17 PM
  2. Replies: 1
    Last Post: 02-18-2013, 02:11 PM
  3. To make an invoice with selected records
    By mercapto in forum Database Design
    Replies: 5
    Last Post: 10-04-2012, 12:49 PM
  4. Invoice number
    By slik_02 in forum Access
    Replies: 3
    Last Post: 08-08-2009, 08:05 AM
  5. Invoice Number
    By rzwoo in forum Access
    Replies: 0
    Last Post: 02-25-2009, 01:30 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