Problem with fixed length of a "patchwork" string

Clueless Newbie

Immortal. So far.
Local time
Today, 12:15
Joined
Feb 6, 2004
Messages
48
Hi all!

Here's another one of my stupid questions:

I have a string
ContractNumber = "9" & Ziffern & ID

"Ziffern" is just a sequence of Zeros
ID is a numerical value starting with 1

The problem is: ContractNumber is supposed to always have exactly 11 digits. The first digit is always a "9", the last one to five digits consist of the recordset's ID. Which in turn means that the length of "Ziffern" depends on the length of "ID".

Is there an easy way to define Ziffern? Preferably one which would still work if the number of digits in ID increased to six or more?

Thank you! :)

Ute
 
Last edited:
It's OK, no need to reply anymore. :) I did it the long way in the end.
 
Here's the quick way ;)

Code:
Const Ziffern = 0000
ContractNumber = "9" & Ziffern & Format(ID, "00000")
 

Users who are viewing this thread

Back
Top Bottom