954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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

nuBudDy
Light Poster
32 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

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

plusplus
Posting Whiz in Training
207 posts since Jul 2007
Reputation Points: 10
Solved Threads: 16
 

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

plusplus
Posting Whiz in Training
207 posts since Jul 2007
Reputation Points: 10
Solved Threads: 16
 

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

nuBudDy
Light Poster
32 posts since Aug 2007
Reputation Points: 10
Solved Threads: 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.

plusplus
Posting Whiz in Training
207 posts since Jul 2007
Reputation Points: 10
Solved Threads: 16
 

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
Light Poster
32 posts since Aug 2007
Reputation Points: 10
Solved Threads: 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:)

nuBudDy
Light Poster
32 posts since Aug 2007
Reputation Points: 10
Solved Threads: 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

plusplus
Posting Whiz in Training
207 posts since Jul 2007
Reputation Points: 10
Solved Threads: 16
 

i got it.thanx a lot plusplus;)

nuBudDy
Light Poster
32 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

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

ask_girl
Newbie Poster
1 post since Feb 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You