Multipart Record Number

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a DB where they need the record number to consist of three parts. The
first is a constant number, "43." The second part is derived from a reason
code in a table which is selected from a ComboBox. (Table contains two
columns; the 2 digit code, 01 thru 09, and the text reason.) The third part
is an auto number. I'll end up with: 43-XX-XXXXX. How do I go about
getting all this to work in my record number field? Thanks in advance!
 
Where is the autonumber portion of the record number coming from? Do the
record numbers have to be unique? Do the records have to increment based on
previously used records numbers?

As an example...if you have 43-01-00001 can the next record number be
43-09-00002 and the next record number be 43-01-00003?
 
Bryan said:
I have a DB where they need the record number to consist of three
parts. The first is a constant number, "43." The second part is
derived from a reason code in a table which is selected from a
ComboBox. (Table contains two columns; the 2 digit code, 01 thru
09, and the text reason.) The third part is an auto number. I'll
end up with: 43-XX-XXXXX. How do I go about getting all this to
work in my record number field? Thanks in advance!

Use a query and leave the individual fields as they are.
The query will have a calculated field named WhatEver
WhatEver: "43-"& comboboxresult & "-" & YourAutonumber
Index all three fields and if your auto number is a real autonumber use it
as the key.
 
Bryan said:
I have a DB where they need the record number to consist of three
parts. The first is a constant number, "43." The second part is
derived from a reason code in a table which is selected from a
ComboBox. (Table contains two columns; the 2 digit code, 01 thru
09, and the text reason.) The third part is an auto number. I'll
end up with: 43-XX-XXXXX. How do I go about getting all this to
work in my record number field? Thanks in advance!

No need to repeat what Mike wrote as that is your answer I believe. I
would note that assuming the 43 will never change you do not need to store
it at all and just add it in as a constant anytime you display the whole
"number".

I also suggest you consider the "autonumber" issue. If you are using
the Access autonumber, you should be aware that you should never count on it
providing numbers in any given order or not skipping numbers. It is
designed to provide unique numbers is a sort of consecutive or random order
only. This confuses a lot of users who expect 1, 2, 3, 4 ... and get 1, 2,
5, 6 ...
 
Record number
yes
yes
yes

rowiga said:
Where is the autonumber portion of the record number coming from? Do the
record numbers have to be unique? Do the records have to increment based on
previously used records numbers?

As an example...if you have 43-01-00001 can the next record number be
43-09-00002 and the next record number be 43-01-00003?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top