DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Visual Basic 4 / 5 / 6 (http://www.daniweb.com/forums/forum4.html)
-   -   using calendar picker from Microsoft calendar control 8.0 (http://www.daniweb.com/forums/thread90545.html)

nuBudDy Sep 24th, 2007 12:32 am
using calendar picker from Microsoft calendar control 8.0
 
hi, i need help on calendar picker.i placed a calendar control on a form.once i click on any date,i want the date value to be inserted into fields in database.i tried searching for the codes bt what i got was a manually designed calendar by a programmer.is it possible to insert those codes in calendar control 8.0?do we need to do the codings manually when using this component?(microsoft calendar control 8.0)

thanks in advance..

plusplus Sep 24th, 2007 2:15 am
Re: using calendar picker from Microsoft calendar control 8.0
 
what exactly are you trying to do? Do you mean that the following doesn't work?
adodc1.recordset("datepicked") = calendar1.value

plusplus Sep 24th, 2007 2:17 am
Re: using calendar picker from Microsoft calendar control 8.0
 
There is also something called monthview, maybe that's what you need?

nuBudDy Sep 24th, 2007 3:40 am
Re: using calendar picker from Microsoft calendar control 8.0
 
i now realize that my main problem is : "i don't exactly know how to use it."
do u mean that by just placing the calendar control on the form, i can straight away use them without having to program anything n just call them with
adodc1.recordset("datepicked") = calendar1.value
when i click on certain date from calendar control, i want the value to be inserted into a field in database.how do i do that?

thanx again plusplus:)

plusplus Sep 24th, 2007 5:04 pm
Re: using calendar picker from Microsoft calendar control 8.0
 
calendar.value
gives you the value of the date clicked
so in the click event of calendar do
adodc1.recordset("datepicked") = calendar.value
That's all
Like I mentioned before, there is also something that's called monthview, it's like the calendar but I think it looks nicer.

nuBudDy Sep 24th, 2007 9:44 pm
Re: using calendar picker from Microsoft calendar control 8.0
 
hey, i think i'm using it,the monthview you said.i used this :
Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
booking_date = MonthView1.Value 'add values into a global variable for use in another form
Unload Me 'unload the current form
CR1.Show 'load another form (where global variable will be used)
End Sub
and it worked well.thank you very much for your help plusplus;)

nuBudDy Sep 25th, 2007 1:10 am
Re: using calendar picker from Microsoft calendar control 8.0
 
i have another thing to add.i want to detect whether date clicked falls on weekend or weekdays so that different form will be loaded.how do i retrieve "day" from the date clicked so i can check it?btw,here are my codes:
Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
booking_date = MonthView1.Value 'add values into a global variable for use in another form
Unload Me 'unload the current form
//*If MonthView1.Value = saturday Or MonthView1.Value = sunday Then 'check if date falls on weekend
CR2.Show 'load another form (where global variable will be used)
Else
CR1.Show
End If

End Sub
thanx again in advance:)

plusplus Sep 25th, 2007 2:23 am
Re: using calendar picker from Microsoft calendar control 8.0
 
Select Case weekday(booking_date)'the function weekday gives you a number 1 sunday, 2 monday etc
Case 1,7
'if it's sunday or saturday
Case else
'if it's any other day
End Select

nuBudDy Sep 25th, 2007 9:31 pm
Re: using calendar picker from Microsoft calendar control 8.0
 
i got it.thanx a lot plusplus;)


All times are GMT -4. The time now is 9:47 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC