'----------------------------------------------------------
' Function: LPad0 (myvalue, MyPaddedLength%)
'
' Description: Pads out a string with 0 in front of the
' value to the length specified
'
'-----------------------------------------------------------
Function LPad0 (MyValue As Variant, MyPaddedLength%)
'-----------------------------------------------------------
Dim PadLength As Integer, X As Integer, PadString As String
If IsNull(MyValue) Then MyValue = "0"
PadLength = MyPaddedLength - Len(MyValue)
For X = 1 To PadLength
PadString = PadString & "0"
Next
LPad0 = PadString + MyValue
End Function