A
AndreasO
Basically keeping the original autonumber and create another auto added one
with the prefix, have all foreign tables use the auto added number while the
autonumber runs in the background....?
All in Main table:
1. Rename and keep the existing autonumber (ProjectID_orig) in order to keep
all existing records as they are.
(do need to delete the relation ships and reinstall after renaming, scary)
2. Create new ProjectID (auto added) and copy all existing original
ProjectIDs into the new field.
3. Create field for year prefix
4. Concatenating the year prefix YY with the ProjectID and have the form do
that at the event Form_BeforeUpdate
Did I think this right, current ProjectID (the autonumber) runs from 1 to
1300 ?
I don't need to change the existing records ProjectID's
I could have a senario where I have two ProjectIDs with one ProjectID_orig,
not good...
What does the concatenating code look like?
How can I set the auto added ProjectID number back to zero at the beginning
of a new year?
Will the foreign tables with the current field ProjectID still run while I
like to keep the existing records' ProjectID?
Can I add the YY prefix and concatenate in the code below for the? How?
Plus restart with 1 at the new year...
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.[ProjectID]) Then
Me.[ProjectID] = Nz(DMax("[ProjectID]", "Main"), 0) + 1
End If
End Sub
Thanks for your help
Andreas
with the prefix, have all foreign tables use the auto added number while the
autonumber runs in the background....?
All in Main table:
1. Rename and keep the existing autonumber (ProjectID_orig) in order to keep
all existing records as they are.
(do need to delete the relation ships and reinstall after renaming, scary)
2. Create new ProjectID (auto added) and copy all existing original
ProjectIDs into the new field.
3. Create field for year prefix
4. Concatenating the year prefix YY with the ProjectID and have the form do
that at the event Form_BeforeUpdate
Did I think this right, current ProjectID (the autonumber) runs from 1 to
1300 ?
I don't need to change the existing records ProjectID's
I could have a senario where I have two ProjectIDs with one ProjectID_orig,
not good...
What does the concatenating code look like?
How can I set the auto added ProjectID number back to zero at the beginning
of a new year?
Will the foreign tables with the current field ProjectID still run while I
like to keep the existing records' ProjectID?
Can I add the YY prefix and concatenate in the code below for the? How?
Plus restart with 1 at the new year...
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.[ProjectID]) Then
Me.[ProjectID] = Nz(DMax("[ProjectID]", "Main"), 0) + 1
End If
End Sub
Thanks for your help
Andreas