By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,836 Members | 2,059 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,836 IT Pros & Developers. It's quick & easy.

calendar activex control

P: n/a
Hi There,
I want to use the calendar control to pick a date field that is set as
date/time in my database. Since
space is limited in my form, I would like to make a small little icon that
the user can click and the calendar pops open.
How can this be done?

Thanks for your help!
smriti


Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Create a pop-up form named MyCalendar and place the calendar on this form.
Name the Calendar "MyCalendarControl". Put the following code in the After
Update event of the calendar control:
Me.Visible = False
Put a Cancel button on the form with the following code in the click event:
DoCmd.Close
On your data entry form, put a command button to open MyCalendar form. A
"Calendar" button should be easy to find - look in Northwind. Put the
following code in the click event of this button:
DoCmd.OpenForm "MyCalendar",,,,,acDialog
If IsLoaded("MyCalendar") Then
Me!NameOfMyDateField = Forms!MyCalendar!MyCalendarControl.Value
DoCmd.Close acForm, "MyCalendar"
End If

You can get the IsLoaded function from the standard modules section of
Northwind. Copy and paste it into a standard module in your database.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

"Smriti Dev" <sm********@utoronto.ca> wrote in message
news:IL********@campus-news-reading.utoronto.ca...
Hi There,
I want to use the calendar control to pick a date field that is set as
date/time in my database. Since
space is limited in my form, I would like to make a small little icon that
the user can click and the calendar pops open.
How can this be done?

Thanks for your help!
smriti

Nov 13 '05 #2

P: n/a
I would stay away from ActiveX controls, especially if you intend to
distribute your database. Search the NG for examples of non-ActiveX
calendars. There's a good one complete with code in Access Developer's
Handbook.

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.