Results 1 to 4 of 4
  1. #1
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    310

    Inoice numbers

    Hi to all,
    What is the best way to obtain an invoice number for each invoice?
    These numbers will appear when printing the invoice.


    (Invoice numbers are supposed to be unique and serial)
    Khalil

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,941
    investigate the DMax+1 concept

    newInvNum=DMax("invnum","tblInvoices")+1

    If being generated at the time of printing, you need to consider whether you are printing one invoice at a time or multiple invoices. And what happens on a reprint? - either for a copy or in the event the printer fails and you need to start again

  3. #3
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,822
    Hi Khalil (Ajax beat me to it)

    The best method is use the following:-

    In the Before Update of the Form

    Me.InvoiceNr = Nz(DMax("InvoiceNr","tblCustomerOrderdates"),0) + 1

  4. #4
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    310
    Hi,
    Thank you both.
    Got it

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

Similar Threads

  1. Replies: 1
    Last Post: 11-11-2020, 08:18 PM
  2. Replies: 4
    Last Post: 09-29-2020, 10:16 AM
  3. Replies: 2
    Last Post: 08-30-2017, 07:11 AM
  4. Replies: 8
    Last Post: 03-10-2014, 11:47 AM
  5. Replies: 1
    Last Post: 11-29-2011, 08:43 AM

Tags for this Thread

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