Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

access can

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

ResolvedVersion 2003

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?

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

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

Access tip:

Using the Quick Access Toolbar in Access 2010

The Quick Access Toolbar is included in virtually every Office product, including Outlook 2010, Word 2010, Excel 2010, and PowerPoint 2010.

You will find the Quick Access Toolbar in the top-left side of the window. To begin, click the Customize button (it's the little black arrow at the end of the toolbar).

Simply click the commands you want to include.

Virtually any command can be added to the Quick Access Toolbar. Click the More Commands option and a new window will open from where you can browse the commands including those not on the ribbon.

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.