L
Leo
I have a Control which is a Date field named 'NEWTOPD'. Based on the date
entered in the field it calculates the days offor the whole month making
amends for Leap-year as well. If I want only the number of days in that month
starting from the date entered in 'NEWTOPD' - to be entered in a calculated
text field (which is a number field) named 'Text361' how should I modify the
following code? Text361 stores the data in (PDDAYS).
'UPDATE (PDDAYS) BASED ON NEWTOPD DATE
Dim iMon As Integer
Dim sDate As String
sDate = (NEWTOPD)
If sDate = "" Then Exit Sub
Select Case Month(sDate)
Case 4, 6, 9, 11
[Text361] = "30"
Case 1, 3, 5, 7, 8, 10, 12
[Text361] = "31"
Case 2
If Year(sDate) Mod 4 = 0 Then
[Text361] = "29"
Else: [Text361] = "28"
End If
End Select
Can someone help?
Thanking you in advance,
Sincerely
Leo
entered in the field it calculates the days offor the whole month making
amends for Leap-year as well. If I want only the number of days in that month
starting from the date entered in 'NEWTOPD' - to be entered in a calculated
text field (which is a number field) named 'Text361' how should I modify the
following code? Text361 stores the data in (PDDAYS).
'UPDATE (PDDAYS) BASED ON NEWTOPD DATE
Dim iMon As Integer
Dim sDate As String
sDate = (NEWTOPD)
If sDate = "" Then Exit Sub
Select Case Month(sDate)
Case 4, 6, 9, 11
[Text361] = "30"
Case 1, 3, 5, 7, 8, 10, 12
[Text361] = "31"
Case 2
If Year(sDate) Mod 4 = 0 Then
[Text361] = "29"
Else: [Text361] = "28"
End If
End Select
Can someone help?
Thanking you in advance,
Sincerely
Leo