Microsoft Access 2010 Add a -1 to 20130001 now may be 20130001-1

I have a table tblrecordlog.  I have a key field but also have a recordnumber in the format the client was using manually before for example 20139999.  I have this number as a double now. The client would like to be able to add a record and a decision would later be made to possibly break up the project into multiple records. They want 20139999-1 for example. Do I set up another table? Do I to change the format of the field? Not each project will be divided. The -1 record would be independed of the original record or maybe I can delete the original record and have them all start out all records with -1.. I am not sure if I like that or not. Can someone give some insight. Thanks.
marlind605Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
als315Connect With a Mentor Commented:
You can always generate string from parts. In your case it will be something like:
=RecordNumber & "-" & ProjectNumber
if RecordNumber is text. If it is numeric, you can add format:
=Format(RecordNumber, "00000000") & "-" & ProjectNumber
0
 
als315Commented:
You can convert recordnumber field to text and use it. Sometimes better to have separate field for project, in this case you can add index for this field and queries can work faster. On forms number and project can be combined.
You should give us more details about DB, if you like to get qualified answer.
I prefer not to use double for numbers without decimal part
0
 
PatHartmanCommented:
If the copied project is completely independent of the project it was copied from, then you would just assign a new number.  The -1 implies that there is some relationship.  If there is a relationship, then the better solution would be to create a new table that can be used to group projects.  You would still assign a new ID.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
marlind605Author Commented:
I do have a seperate number for the index field. The record number is generated by YYYY#### #### being 0001 0 - 9999 My vision is to click on a button on a form correspending to the original record. The button will copy all of the record and the user would change the details to the way they need to. I can change the field to text but I am not sure how to add a -1 based on the recordnumber now text. And it could start with -1 and go to 99 for example. 20130001-1 to 20130001-99.
0
 
PatHartmanCommented:
If the records are not related once they are split, why do you need to add a suffix to the ID field?  Why not just assign the next available number?   If you wanted to track the source, simply add another column to the table where you can store the original ID.  I would use the autonumber PK rather than the generated number for this purpose.
0
 
marlind605Author Commented:
The client wants it this way.
0
 
marlind605Author Commented:
A request will come in the form of an email etc and there may be multiple steps in the request.
0
 
PatHartmanCommented:
If the projects are related, you do "A", if they are not related you do "B".    Sounds like they are related and that requires a structure change so you can group them.  Add an additional column for the suffix because you will now have a second field to increment unless you are going to allow the user to specify the suffix.
0
 
marlind605Author Commented:
RIght now I am using a NZ(Dmax) to generate my current number it places the currentyear in front of a sequencial number based on records that is already in the table. in the table. How do I generate a new number that shows 200130001-1 20130001-2 20130001-3 .... based on 20130001 already in the table. Now all I want to do is allow the user to add another record copy that record and it looks in the table for matching prefix numbers and add another sequence.
0
 
PatHartmanConnect With a Mentor Commented:
When you construct "meaningful" IDs, they should have meaning.  If you will ever want to join the various 20130001 records, you need to put the suffix into a separate column or pay the price later.  If you don't think you would EVER need to bring these records together then, what in the world is the suffix all about?  Adding a second column for the suffix will also mean that you need to add an additional column to the unique index on this field.  Set the default for the column to 0.  After you add the column, you will need to run an update query to replace all null values with 0.  If you prefer to start with 1 rather than 0, then make 1 the default and replace the nulls with 1's.  You'll need to fix the data before you alter the index to avoid duplicates.
0
 
marlind605Author Commented:
PatHartman
The whole purpose of this database is to track records request that is the reason for the name. I have added a field supplemental. Each record does have a never seen by the user ID number auto-number key field. I have created a form that when the user wants to split the request they can do so. The user specifically requested to keep the record number and add-1 to what maybe 1 or multiple split events. So I seem to be looking at a DMAX + 1 solution to see if this solution would work and use the update query like you suggested. I am thinking out loud now. Today I need to make a form where the user clicks add supplemental. Database will copy record assign a new unique number. I need to have it show the 20130001 with a -1 for the new record. Hope this helps. I will be looking at what I can do with this today.
0
 
marlind605Author Commented:
I got it. I will be awarding points later today. No more answers required. Thanks.
0
All Courses

From novice to tech pro — start learning today.