the code fill the combo with all day of the month.
But i need to fill the combo based the current day...
for example today 07/04/2022, start the list of day from 07/04/2022 to the and of last day of the month
for example today 02/04/2022, start the list of day from 02/04/2022 to the and of last day of the month
ecc...
Code: Select all
Private Sub FILL_GIORNI_1()
Dim myVar As String
Dim StartDate As Date
Dim EndDate As Date
Dim ThisDate As Date
myVar = MESE & "-" & ANNO
StartDate = CDate(myVar)
EndDate = DateAdd("d", -1, DateAdd("m", 1, StartDate))
With Me.CGIORNO2
.Clear
For ThisDate = StartDate To EndDate
.AddItem UCase(Format$(ThisDate, "DDD")) & "-" & ThisDate
Next
Me.LNRG.Caption = .ListCount
End With
End Sub