Qbasicnews.com

Full Version: VB6 Calander Program
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
<VB noob here

Im trying to make a calander-ish program

but i suck.


I need it to look like this.


[text box-month][text box-day][text box-year]
[command button]
[textbox-day of the week]

What I need it to do is you can enter any date(september 21st, 1988, october 23rd, 1612) and it will tell you what day of the week it is(wednesday, Tuesday, ect)


So if you put in september 12th 2004, it will say Sunday when you click the command button.




thanks
weekday(date)


the date is in the form of a string and is like

"9/15/2004"

so

msgbox weekday("9/15/2004")

would return 4 (4th day of the week)

so

Code:
datethingy = "9/15/2004"
Select Case Weekday(datethingy)
Case 1: msgbox "Sunday"
Case 2: msgbox "Monday"
Case 3: msgbox "Tuesday"
Case 4: msgbox "Wednesday"
Case 5: msgbox "Thursday"
Case 6: msgbox "Friday"
Case 7: msgbox "Saturday"
End Select

That would return wednesday.



=D
That will work for everything else too?
Quote:That will work for everything else too?
What do you mean?
any month /day /year thats entered
yes anything (I'm pretty sure)