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