Calendar Control

S

skr

Dear All,

Happy New Year -2007. I want to insert a Calendar control in a
form. The date I select is to be seen in a text box control &
ultimately the control source field is to be updated. How to do it?
When I insert the calendar control manually from control tool box, it
does not become visible in the control list in the builder. Hence
refering the object in the Control Source Property of the text box is
not possible. Please help. Thanks in advance.

SKR
 
A

Al Campagna

skr,
What version of Access are you using, and are you trying to create a Macro to update a
Text/Date control with a value from the Calendar?

The Calendar control has some quirks. There is no AfterUpdate event displayed in the
properties box, but in the form's module, that event does exist. Whatever code is in that
module AfterUpdatebut event fires, even though no property in the properties box actually
calls it. (Event Procedure)

But... this method always works....

Say your Calendar control is named [MyCalendar], and the control you want to update is
named [MyDate].
Enter the Code module for the form, and create this EventProcedure...



Private Sub MyCalendar_AfterUpDate()
MyDate = MyCalendar.Value
End Sub

Each time you select a date in the calendar, the MyDate will be updated.

--
hth
Al Campagna
Candia Computer Consulting
Microsoft MVP - Candia, NH USA
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top