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

Recommended Answers

All 9 Replies

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

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

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

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.

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

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

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

i got it.thanx a lot plusplus;)

Member Avatar for ask_girl

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.