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..

Re: using calendar picker from Microsoft calendar control 8.0 80 80

what exactly are you trying to do? Do you mean that the following doesn't work?
adodc1.recordset("datepicked") = calendar1.value

Re: using calendar picker from Microsoft calendar control 8.0 80 80

There is also something called monthview, maybe that's what you need?

Re: using calendar picker from Microsoft calendar control 8.0 80 80

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:)

Re: using calendar picker from Microsoft calendar control 8.0 80 80

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.

Re: using calendar picker from Microsoft calendar control 8.0 80 80

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;)

Re: using calendar picker from Microsoft calendar control 8.0 80 80

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:)

Re: using calendar picker from Microsoft calendar control 8.0 80 80

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

Re: using calendar picker from Microsoft calendar control 8.0 80 80

i got it.thanx a lot plusplus;)

Re: using calendar picker from Microsoft calendar control 8.0 80 80

hello there I would like to ask on how can set a military time with hours/min./sec. using visual basic. because I needed it for my project can you please give a detail code to program it. please send me your reply... thanks for the big help! =)
godbless..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.