[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 865
  • Last Modified:

How do I create custom sequence number in Microsoft Access?

I have field name AWBNumber, I need that field to be autonumber each time data is entered in that table, the AWBNumber needs to be a 11-digit number, custom sequence, and doesn't repeat itself.
the sequence should be like this:
61000100000 +1
61000100001 +1
61000100002 +1
61000100003 +1
61000100004 +6
61000100010 +1
61000100011 +1
and so on...

Is there any solution for this? Should I use the autonumber data type?
Thanks.
0
luisr69
Asked:
luisr69
  • 3
  • 2
1 Solution
 
ashish908Commented:
Access does not support autonumber with defined starting number, so i guess you will have to programmatically control it
0
 
Patrick MatthewsCommented:
AutoNumber is a Long behind the scenes, so it will not support an 11 digit number (Long maxes out at ~2.1 billion).ashish908,The Access UI does not support it, but there are ways to do it nonetheless:http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_20676131.htmlPatrick
0
 
luisr69Author Commented:
CurrentDb.Execute "ALTER TABLE MyTable ALTER Column CustID Counter (100,5)"
Starts from 100 and increases by 5

in that case above, what would be the data type?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Patrick MatthewsCommented:
>>in that case above, what would be the data type?AutoNumber, but stored as LongAs I already indicated, if you need an 11-digit number, AutoNumber is not an option for you.
0
 
luisr69Author Commented:
okay, thanks for that.
what about the +6 after four +1 increments?
0
 
luisr69Author Commented:
Thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now