[mso] Re: Access Auto Number Question
- From: "Jim Pettit" <j_e_pettit@xxxxxxxxxxx>
- To: <mso@xxxxxxxxxxxxx>
- Date: Fri, 21 Jan 2005 10:33:58 -0800
Christine--
This isn't an autonumber problem; those work fine. What you're evidently
looking for is a custom numbering system. To implement such a system, you'll
need to define a text field in your table (since you have the hyphen) with a
set length of 7 characters. You'll next need to create a function that's
called every time a new record is added to the table. The function will
first strip the last numeral of the year from the VB intrinsic 'Date()'
function, append a hyphen ('-') character, then (and this is the tricky
part) append a 5-digit string (with the initial value, or 'seed', being
whatever you want. It sounds more complicated than it is; you could actually
do it all in just one line in the query window.
For what it's worth: to prevent redundancy, you should also include a TRUE
autonumber field in the table. Also, out of curiosity, what happens after
2009? Or when you get more than 10,000 records?
--Jim
-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On Behalf
Of McDonald, Christine, Ms, DCAA
Sent: Friday, January 21, 2005 9:36 AM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Access Auto Number Question
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Hi all,
We are having trouble getting the autonumber to work properly in Access.
We need to create a 6 digit number, where the first digit represents the
year, (ie, 2005 = 5, 2006=6), then a dash, then a 5 digit sequential
number. So the autonumber would look like 5-04728. And we need to
specify the starting number, in other words it is not going to start with
00001.
We are using Access 2002 at this time, although I believe we will be
upgrading to 2003 sometime in the next few months.
Thanks,
Christine McDonald, CPA
Technical Specialist
Western Regional Office
Information Technology Division (RSA-4)
-- Binary/unsupported file stripped by Ecartis --
-- Type: application/x-pkcs7-signature
-- File: smime.p7s
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx
To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
To Unsubscribe from this group, send an email to
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes)
in the subject line.
Or, visit the group's homepage and use the dropdown menu. This will also
allow you to change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso
To be able to use the files section for sharing files with the group, send a
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation
with instructions. Once you are a member of the files group, you can go
here to upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx
To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
To Unsubscribe from this group, send an email to
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in
the subject line.
Or, visit the group's homepage and use the dropdown menu. This will also allow
you to change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso
To be able to use the files section for sharing files with the group, send a
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with
instructions. Once you are a member of the files group, you can go here to
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************
- References:
- [mso] Access Auto Number Question
- From: McDonald, Christine, Ms, DCAA
Other related posts:
- » [mso] Access Auto Number Question
- » [mso] Re: Access Auto Number Question
- » [mso] Re: Access Auto Number Question
- [mso] Access Auto Number Question
- From: McDonald, Christine, Ms, DCAA