A
Andy Roberts
I think I have made a problem for myself by the way I have structured my
table.
I have a database which has in it legacy data relating to tenders and jobs
Up to now everything has been paper based hence the need for the database).
Every tender we send out has an incrementing number which is 4 digits and
just increments by 1 each time. The same goes for any job we do (4 digit
sequential number) and I therefore have the same problem in both tables.
I have a tblTenders with a primary key which is an autonumber called
TenderID and a second field which is a description of the tender called
TenderDesc.
I also have a tblJobs with a primary key which is an autonumber called JobID
and a second field which is a description of the job called JobDesc.
I have a button on a main form which opens an "Add New Tender Form" which is
blank. What I need to happen now is that the TenderID field needs to find
the largest number (ie the last tender) and automatically assign a new
number which is the last number +1. My problem seems to be that the
tenderIDs I have imported (over 3000 of them) are all in the Primary key
(autonumber) field. What is the best way to combat this and what code do I
need?
I need to do the same thing for the job table (and eventually have the
tender turn into a job using an append query via a button). The append
query would then need to generate the unique job number. but one step at a
time....
--
Regards
Andy
___________
Andy Roberts
Win XP Pro
Access 2007
Liverpool, UK
table.
I have a database which has in it legacy data relating to tenders and jobs
Up to now everything has been paper based hence the need for the database).
Every tender we send out has an incrementing number which is 4 digits and
just increments by 1 each time. The same goes for any job we do (4 digit
sequential number) and I therefore have the same problem in both tables.
I have a tblTenders with a primary key which is an autonumber called
TenderID and a second field which is a description of the tender called
TenderDesc.
I also have a tblJobs with a primary key which is an autonumber called JobID
and a second field which is a description of the job called JobDesc.
I have a button on a main form which opens an "Add New Tender Form" which is
blank. What I need to happen now is that the TenderID field needs to find
the largest number (ie the last tender) and automatically assign a new
number which is the last number +1. My problem seems to be that the
tenderIDs I have imported (over 3000 of them) are all in the Primary key
(autonumber) field. What is the best way to combat this and what code do I
need?
I need to do the same thing for the job table (and eventually have the
tender turn into a job using an append query via a button). The append
query would then need to generate the unique job number. but one step at a
time....
--
Regards
Andy
___________
Andy Roberts
Win XP Pro
Access 2007
Liverpool, UK