How to generate a unique Order Number starting with ORD?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Connor Columbus
    New Member
    • Jan 2011
    • 4

    How to generate a unique Order Number starting with ORD?

    The Order Number must be like this:

    ORD0000

    Thats "ORD" at the beginning followed by 4 numbers, I need to find the max existing Order Number and add 1 to this calculation as well.

    So basically I need to know how to make a form automatically generate a new order number starting with ORD but I have to find the max and add 1 on to this to make it unique. Any ideas?
  • orangeCat
    New Member
    • Dec 2007
    • 83

    #2
    First, You need to find the Max(OrderNumber ).

    A query such as
    Select Max(orderNumber ) from OrderTable

    Comment

    • Connor Columbus
      New Member
      • Jan 2011
      • 4

      #3
      Because its in a form would I double click on the text box and set the default value as this? & do you know how to make the ORD at the beginning?

      Comment

      • mshmyob
        Recognized Expert Contributor
        • Jan 2008
        • 903

        #4
        Connor because this is a homework question we do not answer these. You have also asked this same question in another thread and were given pointers.

        After trying to do it yourself you can post back your code and we will be happy to help out but we don't do your homework for you.

        cheers,

        Comment

        Working...