I am not sure if this will work like this. The table that I have right
now has 1000 active accounts. There are no leads (CRMs) in this table.
The agent gets leads by email and will start putting them into the db
so that we can track them. That is why I was looking for a way so that
he/she could hit a button and it would automatically generate a
number. The only way of doing this that I could think of would be to
1. Query the table for accounts starting with CRM
2. Add 1 to the last account
Of course this is easy to say, but I have no clue how to do this.
James,
Here's some code written by Klatuu that should give you an idea
or two on doing what you are asking for:
______________________________________________________
strNext = DMAX("[FieldNameHere]","TableNameHere")
intNext = Cint(Replace(strNext, "L-",""))
strNext=left(strNext, 2) & format(intNext + 1, "0000")
______________________________________________________
I guess I should back up to the beginning. What do you need the
"EP9999 or CRM9999" for? I got a little ahead of myself there.
To properly assist you in what you were asking for I should have
started off with why do you need this particular numbering system.
Right off the bat it has a limit of 10,000 without some additional
codine and maybe a little resturcturing of the field.
Again, are there ever duplicate numbers in EP and CRM or do you just
change the prefix?