Time for a quick answer,
Try using the DateAdd() function:
' Replace
strCheckDate = PayArray(z) + 30
' With
strCheckDate = DateAdd("d",30,PayArray(z))
I like the naming conventions used for variable declaration. Such as str, int, and the like. And I commend your use/consistency of use. Just, one suggestion instead of using str on a date variable try using dtm for the prefix and save str for string variables.
You may also want to verify that PayArray(z) is a valid date. You can use the IsDate() function:
If IsDate(PayArray(z)) = True Then
' Add 30 days to the date
dtmCheckDate = DateAdd("d",30,PayArray(z))
Else
' Invalid date
' Do some error handling
End If
Hope this helps.
Larry Asher
|