Hi There,
I need your help.
I have now idea why I would be getting a Run-Time Error #9 "Subscript out of Range" with the following function:
I desperately need your help:
Dim today As Variant
Dim Date2 As Variant
Date2 = frmIMTS.h10.Value
today = Split(Format(Date, "dd/mm/yyyy"), "/")
today = DateSerial(CInt(today(2)), CInt(today(1)), CInt(today(0))) <- Errors here
Date2 = Split(Date2, "/")
Date2 = DateSerial(CInt(Date2(2)), CInt(Date2(1)), CInt(Date2(0)))
DaysDue = DateDiff("d", today, Date2)
If DaysDue < 0 Then
frmIMTS.h10.BackColor = RGB(255, 192, 192)
msg_eng = "is over due by " & Abs(DaysDue) & " day(s)."
msg_fre = "est en retard par " & Abs(DaysDue) & " jour(s)."
ElseIf DaysDue > 0 Then
frmIMTS.h10.BackColor = RGB(192, 255, 192)
msg_eng = "will be due in " & DaysDue & " day(s)."
msg_fre = "sera dû dans " & DaysDue & " jour(s)."
ElseIf DaysDue = 0 Then
frmIMTS.h10.BackColor = RGB(255, 255, 192)
msg_eng = "is due today."
msg_fre = "est dû aujourd'hui."
End If
Any help with this is greatly appreciated.
Much thanks and appreciation.
Cheers,
Jay
Bookmarks