Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CALENDAR (ACTIVE X) 2

Status
Not open for further replies.

KUZZ

Technical User
Aug 13, 2002
254
0
0
GB
how do I transfer value from my ACTIVE X calendar on a form, to a control, [text0], on the same form? Good luck,
Kuzz

"Time spent debating the impossible subtracts from the time during which you
can try to accomplish it."
 
This is what I did to make the a text box equal to the value of the calendar control.

first i created a form load event making the calendar control value equal to the current date.

Private sub form_load()
Me!ocxCalCon.Today
End Sub
(the ocxCalCon is the name of my calendar control sub your calendar name in its place) doing this makes the calendar appear highlighted to the current date when the form loads. Great for giving them a starting date place.

Second i created a click event so when the user clicked on a date in the calendar control the associated text box would display the date/value that the user selected.

Private Sub ocxCalCon_Click()
txtDateSelected.Value = ocxCalCon.value
Me.Requery
End Sub

I am taking the text box txtDateSelected and making its value equal to the value of the calendar control value. Since my form is bound to a query I added a line to requery the query. I use the text box as a criteria for the query in order to keep what is displayed on the form current with what ever date the user selects. It works quite well. The user's like it anyway.

hope this helps.


greg
 
Tha sounds like a good approach...
I'll tell you what I have come up with...

time set to 10 or 50 or whatever
on timer i do the following
if control1 = activexctl1 then
exit sub
else
control1=activxctl1
end if
end sub

works just fine... Good luck,
Kuzz

"Time spent debating the impossible subtracts from the time during which you
can try to accomplish it."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top