>>>Sub Cleanup(Optional tnError As Integer)
>>>
>>>' If we pass a parameter
>>>If VarType(tnError) = 2 Then
>>> lnLastError = tnError
>>>End If
>>>
With that specific code, tnError will be 0 if nothing is passed. If 0 means something else, then you will have to use IsMissing, otherwise, you could just check for 0.
Jay Shepherd