473,320 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Custom Autonum values

ssb
Hello,

I need to have a column in MS-Access table, which will be an
autonumber of the type LNNN.

(NNN is a number and 'L' is just an alphabet)

This column is also the primary key. In other words, I need values
like L001, L002 etc for consecutive records.

How do I go about it?

Thanks.
Nov 13 '05 #1
1 1211
<<
I need to have a column in MS-Access table, which will be an
autonumber of the type LNNN.

(NNN is a number and 'L' is just an alphabet)

This column is also the primary key. In other words, I need values
like L001, L002 etc for consecutive records.

How do I go about it?

Thanks.


Either have a function that creates the new value for the text field each time
a new record is being entered or just don't include the L in the field at all
for the numeric field and only show the L on forms and reports but not as part
of the field to be entered.

And if you know the first character is always one character wide and the
numeric part is always the last 3 characters:

The first character can be referenced:
Left([MyField], 1)

And the last 3 characters:
Right([MyField], 3)

Or you may want to check for Null first perhaps doing something like this:
If Not IsNull([MyField]) Then
TheLeftPart = Left([MyField], 1)
Else
TheLeftPart = ""
End If
Best regards,
J. Paul Schmidt, Freelance Access and ASP Web Developer
www.Bullschmidt.com
Classic ASP Design Tips, ASP Web Database Demo, ASP Bar Chart Tool...
Nov 13 '05 #2

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

Similar topics

3
by: Jen LaForge | last post by:
Thanks for the help before I even start... I'm working in Access and I have right now 1024 records. We have a field set to Autonum that gives each new record a new file number. The problem? We...
1
by: Jay | last post by:
I have a database that uses AutoNum for Customer Number and every once in a while when entering a new customer the AutoNum goes back and uses a number already used. So instead of using the next...
3
by: Joe Bloggs | last post by:
Does anyone know if its possible to pass parameters or the values of Request.QueryString from a web page to a custom control class? I'm using a C# Web Application. For Example I have Web Page1...
21
by: One Handed Man \( OHM - Terry Burns \) | last post by:
When using a custom control. In order to check and see if values have changed one has to implement the IPostBackDataCollection interface. The values returned for the control seem to be simply a...
4
by: Rico | last post by:
Hello, I'd like to change a field from an Autonum to a Long data type using DAO. I knwo how to set the attribute, but don't know how to remove it. Any ideas? Thanks!
17
by: Rico | last post by:
Hello, I am in the midst of converting an Access back end to SQL Server Express. The front end program (converted to Access 2003) uses DAO throughout. In Access, when I use recordset.AddNew I...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.