Date/Time - need help

wooglin

Newcomer
Joined
Oct 24, 2003
Messages
7
Can someone help me default my numerous radiobuttons per the current date?

Basically what I am looking for is the program to look at the system date, determine whether it is Monday, Tuesday...etc., then have the radio button checked as the default date (IE, if its Tuesday, the Tuesday radio button is checked....etc)

Code so far:

Select Case Format(Now, "dddd")

Case "Monday"
btnMonday.Checked = True
Case "Tuesday"
btnTuesday.Checked = True
Case "Wednesday"
btnWednesday.Checked = True
Case "Thursday"
btnThursday.Checked = True
Case "Friday"
btnFriday.Checked = True
Case "Saturday"
btnSaturday.Checked = True

End Select


All help is appreciated.
 
I am not sure what you mean??

is there a way I can just code it to reconize the current day of the week, then set my radiobuttons to default to current day?
 
Use DateTime.Now.DayOfWeek. Just for example:
Visual Basic:
If DateTime.Now.DayOfWeek = DayOfWeek.Tuesday Then
  MessageBox.Show("It's Tuesday!")
End If
 
Just figured it out. What I did was put the select case in the form load section, so that when the form loads, btnFriday is defaulted, because today is Friday. Then I can change the button to, say Tuesday, and the info for Tuesday pulls up when asked....

Thanks for your help (or at leasttrying)!
 
Back
Top