RP1America
Technical User
I have a user form with two comboboxes.
The first a user selects a year. (txtYoA)
The second is a month/last day of month combination (e.g. 1/31) containing all 12 months. (txtPYE)
If the user selects a year that is a leap year in the first combobox, I want the second combobox to additem 2/29 instead of 2/28.
Using:
and
How do I insert the selected value of txtYoA on the fly? The code above currently returns true (assuming because it is basing off of this year - 2012?). So if the user selects 2011 from the txtYoA combobox, how do I incorporate that into the code?
The first a user selects a year. (txtYoA)
The second is a month/last day of month combination (e.g. 1/31) containing all 12 months. (txtPYE)
If the user selects a year that is a leap year in the first combobox, I want the second combobox to additem 2/29 instead of 2/28.
Using:
Code:
IsLeapYear = Month(DateSerial(j, 2, 29)) = 2
Code:
If IsLeapYear = False Then
.AddItem "2/28"
ElseIf IsLeapYear = True Then
.AddItem "2/29"
End If
How do I insert the selected value of txtYoA on the fly? The code above currently returns true (assuming because it is basing off of this year - 2012?). So if the user selects 2011 from the txtYoA combobox, how do I incorporate that into the code?