473,508 Members | 2,303 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unique Number Questions - Numbering Sequence

I am working on a license program in Access 2000. Every year, the county
assigns a block of numbers to be used. When someone applies for a license,
they are assigned from that group. For example, the block of number for
2002 was 11451 to 11800. The starting number was 11451, so the first person
who applied for the license got that number. The next person got 11452.
Each year, the block of number changes. So this year, the numbers start
with 19001. When the person enters in the information on a form, the next
License number will be assigned. How do I do this?

Thank you for your help
Katie
Nov 12 '05 #1
1 4796
On 30 Nov 2003 14:36:21 -0800, da*******@yahoo.com (Katie M) wrote:

I would create a new table:
YearForBlock
BlockBeginNo
BlockEndNo
BlockCurrentNo
I would add the data for 2003 and 2004.
Then write a public function that based on the current year
(=Year(Date)) would either return an error because the BlockEndNo has
been exceeded or YearForBlock doesn't exist, or return a new number
and increment BlockCurrentNo. I would do this in a transaction, so
reading and updating both happen, or neither happens. If it's a
multiuser app, I would also add error handling to deal with a locked
table (likely meaning someone else was just getting a number; I would
sleep (Sleep(500)) a bit and try again a few times.

Then in your code call this function when you need a new number. You
can also call this function from an Append query, if that's the way
you add a new record.

If your number field currently is an Autonumber, convert it to Long
Integer.

-Tom.

I am working on a license program in Access 2000. Every year, the county
assigns a block of numbers to be used. When someone applies for a license,
they are assigned from that group. For example, the block of number for
2002 was 11451 to 11800. The starting number was 11451, so the first person
who applied for the license got that number. The next person got 11452.
Each year, the block of number changes. So this year, the numbers start
with 19001. When the person enters in the information on a form, the next
License number will be assigned. How do I do this?

Thank you for your help
Katie


Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5731
by: Alex | last post by:
Acc 97 Hi, I am in need of some help here.... I have a query which is based upon time, where i need to plot the hours a job has been working.. therefore, oN & off in a union query. ...
8
2112
by: Abhishek | last post by:
Hi! I need to create a unique password everytime i click a button . what technique/Algo should i follow. Abhishek
3
2572
by: Chris | last post by:
Before I started to create table, etc to track unique form field record number assigments I thought I'd check to see if there is now a better way to do this in .NET. I have a parent form (table)...
0
1040
by: curts_access | last post by:
Hello. I have table that has this type of data except for column "location" location ID Cnum Company Address 1 1 10123 ABC Inc. California 1 2 10124 Big Company Nevada 1 3 10125 Company...
0
1061
by: Jean-François Michaud | last post by:
Hello all, I'm looking into putting together an alternate page numbering on a figure element that we have to deal with. Each figure has its own page sequence through the use of an...
2
4011
by: pstachy | last post by:
Hi again! I have another issue. I would like the attribute of the tag <invoice> to be unique. Made the following schema but unfortunately it doesn't validate. Could someone please indicate what is...
11
7760
by: garyhoran | last post by:
Hi Guys, I have a collection that contains various attributes (stuff like strings, DateTime and Timespan) . I would like to access the collection in various orders at different points in the...
8
7187
by: Marc | last post by:
Hi all, I have to generate and send to a printer many 6 digit alphanumeric strings. they have to be unique but I cannot check in a database or something like that if it have already been printed....
1
2634
by: reachkaruna | last post by:
Hi All, I have the following XSD where my "number" is having unique constarint <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"...
0
7225
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7324
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7495
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3193
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3181
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1556
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.