I have the following code which works fine and does exactly as I want it to. However this code applies to one command button and there are 14 - I would like to cut down on the bloat and try to get this into a loop. The code below works for all of my buttons Command00 to Command13 and list00 to list13 when the value of WeekDay(Date + (0) ,1) is incremented by 1, going from zero (example below) up to the value of 13.
The final result shows the comming 14 days in 'Mon', Tue', 'Wed' format with the 'Sat' and 'Sun' buttons disabled.
solo7![[thumbsup2] [thumbsup2] [thumbsup2]](/data/assets/smilies/thumbsup2.gif)
The final result shows the comming 14 days in 'Mon', Tue', 'Wed' format with the 'Sat' and 'Sun' buttons disabled.
Code:
Dim IntDayOfWeek
List00_Label.innerText= FormatDateTime(Date + (0), 2)
IntDayOfWeek= WeekDay(Date + (0) ,1)
If IntDayOfWeek=7 or IntDayOfWeek=1 then
Command00.innerText= WeekDayName(IntDayOfWeek,True)
Command00.disabled = True
else
Command00.innerText= WeekDayName(IntDayOfWeek,True)
end If
solo7
![[thumbsup2] [thumbsup2] [thumbsup2]](/data/assets/smilies/thumbsup2.gif)