View Single Post
  #1 (permalink)  
Old July 4th, 2008, 06:33 PM
rsearing rsearing is offline
Friend of Wrox
 
Join Date: Jul 2006
Location: olathe, ks, USA.
Posts: 238
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via MSN to rsearing
Default Using month & year variable to get date in range

I have an "Event" table where I am going to be storing dates. I then have a calendar control and want to "select" or "highlight" the dates from my table that relate to the month chosen. I know how to do this with something like:

For Each tdate As Date In testDates
            Calendar1.SelectedDates.Add(tdate)
Next

My question is - how can I:

a) tie into the month changing event
b) grab the current month and year of the calendar control
c) use these to query the event table to only get events in the month and year passed to it?

THANKS!! - in the past, I never used "dates" but would store integers to store month, day and year - but would wind up writing too much custom code to work with dates where I think it would be easier to just store the date in the table.

Sincerely,
Rob