98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Access Training and help » Primary key - Appending and auto number to a set prefix
Primary key - Appending and auto number to a set prefix
Resolved · Low Priority · Version 2003
Nam has attended:
Access Introduction course
Access Intermediate course
Access VBA course
Access Advanced course
Primary key - Appending and auto number to a set prefix
I have got 2 tables, tblClient and tblInvoicing on a one to many relationship respectively. How do I number my Invoice numbers (Primary ID field) such that they contain a prefix "PREM" then auto number of 6 fields e.g. PREM000001 for the first invoice number, PREM000010 for the tenth. How do I get the 4 letter prefix depending on the client e.g "PREM" for Premier, "CAST" for castlefield.
RE: Primary key - Appending and auto number to a set prefix
Hi Nam, Thank you for the post, welcome to the forum, in answer to your question, try this, create your database or amend your existing database, in the ID field which I assume you have as an Autonumber field, (remember you can only link an autonumber to a Double Integer field), in the Table design view, select the ID field and in the Format line of the field properties enter the following for your Premier Table.
"PREM"000000
With the zeros being the number of numbers you require, for your other table obviously substitute the PREM with CAST,
I hope that works, it usually does, if so, please click the Resolved link, best regards Pete
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Access tip:Creating Parameter wildcard queriesTo creat a parameter query that also uses a wildcard, in the query design type in like []+*. |