?
Solved

How do I create custom sequence number in Microsoft Access?

Posted on 2010-09-14
6
Medium Priority
?
851 Views
Last Modified: 2013-11-28
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
Comment
Question by:luisr69
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 

Expert Comment

by:ashish908
ID: 33673520
Access does not support autonumber with defined starting number, so i guess you will have to programmatically control it
0
 
LVL 93

Accepted Solution

by:
Patrick Matthews earned 2000 total points
ID: 33673581
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
 

Author Comment

by:luisr69
ID: 33673837
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 33673912
>>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
 

Author Comment

by:luisr69
ID: 33674086
okay, thanks for that.
what about the +6 after four +1 increments?
0
 

Author Closing Comment

by:luisr69
ID: 33717053
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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question