Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

autonumber help

Status
Not open for further replies.

ChipF

Technical User
Nov 15, 2002
50
US
Is there a way to add a digit (number or letter) automatically to an autonumber as a primary key?
 
Give us an example of what you mean, ie do you want numbering to be 1A, 2B, 3C or what?

If you set up an autonumber field "No_A" and another text field "TextB" which will be your primary key; run a line of code so that when a new record is created on a form it runs:

Me!.textB = Me!.No_B & "A" (note you will need to name text boxes on your form more appropriatly!)

This will take your autonumber field and add A onto the end of each one.

Hope this helps....

"Experience is a wonderful thing which allows you to recognise a mistake when you make it, again...."

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top