This is my take on your question. For ease I'm using a checkbox array instead of individual controls.
Code:Private Sub cboDays_Click() Dim dteTemp As Date Dim intMonth As Integer Dim intYear As Integer Dim i As Integer 'find the first selected day of the month intMonth = Month(Date) intYear = Year(Date) dteTemp = DateSerial(intYear, intMonth, 1) Do While Format(dteTemp, "dddd") <> cboDays.Text dteTemp = DateAdd("d", 1, dteTemp) Loop ' Add tooltips to the checkboxes For i = 1 To 5 chkWeek(i - 1).ToolTipText = DateAdd("ww", i - 1, dteTemp) Next i End Sub Private Sub Form_Load() Dim i As Integer cboDays.AddItem "Sunday" cboDays.AddItem "Monday" cboDays.AddItem "Tuesday" cboDays.AddItem "Wednesday" cboDays.AddItem "Thursday" cboDays.AddItem "Friday" cboDays.AddItem "Saturday" For i = 1 To 5 chkWeek(i - 1).Caption = "Week " & i Next i End Sub




Reply With Quote