A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Creating Field With combo of autonumber and text



 
 
Thread Tools Display Modes
  #1  
Old July 16th, 2009, 04:30 PM posted to microsoft.public.access.tablesdbdesign
Benjamin
external usenet poster
 
Posts: 77
Default Creating Field With combo of autonumber and text

Hello,

I'm looking to create a field that has both an autonumber component and a
static text portion. So, instead of having as an ID# the simple autonumber
function of 1,2,3 etc., I want to have it generated to be something like:
CCA0001, CCA0002...CCA0135 etc.

Any ideas? Thanks!
  #2  
Old July 16th, 2009, 05:48 PM posted to microsoft.public.access.tablesdbdesign
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Creating Field With combo of autonumber and text

If the prefix is ALWAYS the same then use the autonumber like this --
MyID: "CCA" & Right("000" & [AutonumberField], 4)

Bear in mind that an autonumber field may skip a number or more in sequence.

--
Build a little, test a little.


"Benjamin" wrote:

Hello,

I'm looking to create a field that has both an autonumber component and a
static text portion. So, instead of having as an ID# the simple autonumber
function of 1,2,3 etc., I want to have it generated to be something like:
CCA0001, CCA0002...CCA0135 etc.

Any ideas? Thanks!

  #3  
Old July 16th, 2009, 06:11 PM posted to microsoft.public.access.tablesdbdesign
Benjamin
external usenet poster
 
Posts: 77
Default Creating Field With combo of autonumber and text

Thank you! But where do I put that formula in? And what does the "4" represent?



"KARL DEWEY" wrote:

If the prefix is ALWAYS the same then use the autonumber like this --
MyID: "CCA" & Right("000" & [AutonumberField], 4)

Bear in mind that an autonumber field may skip a number or more in sequence.

--
Build a little, test a little.


"Benjamin" wrote:

Hello,

I'm looking to create a field that has both an autonumber component and a
static text portion. So, instead of having as an ID# the simple autonumber
function of 1,2,3 etc., I want to have it generated to be something like:
CCA0001, CCA0002...CCA0135 etc.

Any ideas? Thanks!

  #4  
Old July 16th, 2009, 07:04 PM posted to microsoft.public.access.tablesdbdesign
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Creating Field With combo of autonumber and text

where do I put that formula
In the queries that feed your forms or reports.

what does the "4" represent

Numbers do not have leading zeros. This adds zeros but because the number
of digits is unknown the process takes the right 4 characters after putting
zeros in front of the number.

--
Build a little, test a little.


"Benjamin" wrote:

Thank you! But where do I put that formula in? And what does the "4" represent?



"KARL DEWEY" wrote:

If the prefix is ALWAYS the same then use the autonumber like this --
MyID: "CCA" & Right("000" & [AutonumberField], 4)

Bear in mind that an autonumber field may skip a number or more in sequence.

--
Build a little, test a little.


"Benjamin" wrote:

Hello,

I'm looking to create a field that has both an autonumber component and a
static text portion. So, instead of having as an ID# the simple autonumber
function of 1,2,3 etc., I want to have it generated to be something like:
CCA0001, CCA0002...CCA0135 etc.

Any ideas? Thanks!

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:43 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.