By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,625 Members | 1,636 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,625 IT Pros & Developers. It's quick & easy.

Custom Autonum values

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
<<
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 discussion thread is closed

Replies have been disabled for this discussion.