access can
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Access Training and help » Access 2003 - Can I add a calendar to a form so it displays prop

Access 2003 - Can I add a calendar to a form so it displays prop

resolvedResolved · Medium Priority · Version 2003

replyReply Tue 3 Jan 2012, 12:03Delegate Maewyn said...

Maewyn has attended:
Access Intermediate course

Access 2003 - Can I add a calendar to a form so it displays prop

Hi. I have added a calendar to my form so that users can easily select a date to complete a field. However I can't get the date selected into the right field, nor can I shrink the calendar down to a small button and only open up when it is clicked on. Any ideas?

For upcoming training course dates see: Pricing & availability

replyReply Thu 5 Jan 2012, 14:08Trainer Simon said...

RE: Access 2003 - Can I add a calendar to a form so it displays

Hi Maewyn,

Thank you for your question.

There are two possible ways of doing this. if you have added an Active X Calendar Control then you will need to copy the following VBA code into a new procedure in the VBA window.

Private Sub MyCalendar_Click()
Me.Test.Value = Me.MyCalendar.Value
End Sub

In this example the fieldname is called 'Test' and the Calendar Control is called MyCalendar.

Open the form in Design View and do ALT + F11 on the keyboard to open the VBA window. On the left hand side you will see a panel. Double click on the form you created and paste the code into the right hand window.

The date selected on the calendar control will be displayed in the text box.

Alternatively add a Text field in Design View of the form and open the properties window. Change the format of the field to Short Date. When they click into the text box a calendar control icon appears and when selected a drop down calendar appears. Whichever date is selected the date appears in the text box.

I hope this helps you and answers your question.

Regards

Simon

replyReply Thu 5 Jan 2012, 16:22Delegate Maewyn said...

RE: Access 2003 - Can I add a calendar to a form so it displays

Simon, I tried the second one of these but it didn't work at all. The first one I didn't try because we have very limited use of ActiveX here.


I eventually found a control call Microsoft DatePicker, which is in the standard list of controls - many thanks to the blog t http://blogannath.blogspot.com/2010/06/microsoft-access-tips-tricks-using-date.html - and this does exactly what I need.

Maewyn

 

Please browse our web site to find out more about
access courses and other Microsoft training courses.

Access tip:

Undo Entries In Records

To Undo any entries or changes in records:

Hit the ESC key once for the current field

And ESC twice for current record

View all Access hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard