The Last contact code is stored in Number Series Defaults setting (in System module).
If you would change that number to the last 6 digit customer code, that you have, then the next customer will get a 6 digit number.
(and yes, the system always saves the last number entered, so if you change the sequence to 7 digits, then it will pick the next number from that one).
It is possible to change the customer number with the conversion routine.
You can read more about this from the online manual: wwwhansamanuals.com
Search for the Conversion - Customers
I hope it helps