All needs to be writen in VBA.
I would probably go with a sequence number that is unique, starting at 10001. Or an autonumber that simply starts at 1.
Now create a function that takes the Lastname as Input (possibly the AutoID too). Then it gets the unique number and takes the last 4 numbers to add to the last name (possibly padding the number with 000, if needed).
For the first 10000 customers you are guaranteed a unique ID of XXX9999
Now you need to search your usernames to make sure that the new userid doesnt exist yet...
For this lookup "openrecordset" in the access help or on the forum... to give you an idea of what to do.
Now the problem with this userid is... if your customer base gets big enough ....
You will run into the situation where you have 10000 unique customers named
Jansen
Janssen
Janszen
Jansens
Janszens
Janssens
Yes this is true in the NL and Jansen is actually one of the most common surnames together with Vries.
Now XXX9999 no longer fits to make a unique userID... So what then???
I would probably go with a sequence number that is unique, starting at 10001. Or an autonumber that simply starts at 1.
Now create a function that takes the Lastname as Input (possibly the AutoID too). Then it gets the unique number and takes the last 4 numbers to add to the last name (possibly padding the number with 000, if needed).
For the first 10000 customers you are guaranteed a unique ID of XXX9999
Now you need to search your usernames to make sure that the new userid doesnt exist yet...
For this lookup "openrecordset" in the access help or on the forum... to give you an idea of what to do.
Now the problem with this userid is... if your customer base gets big enough ....
You will run into the situation where you have 10000 unique customers named
Jansen
Janssen
Janszen
Jansens
Janszens
Janssens
Yes this is true in the NL and Jansen is actually one of the most common surnames together with Vries.
Now XXX9999 no longer fits to make a unique userID... So what then???