That's up to you on the 6-digit thing. You know the technique now, but you need to figure out something that is unique and is only 6 digits. I use the now() function, because it goes down to the second, and I concatenate it with the username, because it's nearly impossible for a user to submit two separate forms in the same split second. I can't just use the date or time from now(), because those are much less unique.
Why can you not use my auto-numbering technique that leverages the SharePoint ID for the form itself?