Solved

How do I create custom sequence number in Microsoft Access?

Posted on 2010-09-14
6
833 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
  • 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 92

Accepted Solution

by:
Patrick Matthews earned 500 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 92

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now