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

How to use Calendar in Access 2003

P: 13
Hello guys,
I am using Access 2003 and in my form I have 3 date fields,Ord Date, Recvd Date, Due Date, user needs a calendar button so when clicked it shows calendar and when date is selected in reflects into the date field and after selection it minimizes the calendar , so any suggestion how I can achieve it and will it obey the validation rule too if selected from calendar as I have beforeupdate it checks Ord Date and Due date should be greater then Recvd Date

I know using toolkit I can get Calendar but how to implement its hard for me.

Thanks in advance..

Jul 10 '08 #1
Share this Question
Share on Google+
3 Replies

Expert 2.5K+
P: 3,532
Someone is going to come along and suggest that you not use the ActiveX Calendar control that comes with Access, because of problems that it can cause, and suggesting some non-ActiveX calendars that you can use instead. Whether ActiveX Calendars cause problems really depends on your use of it. An ActiveX Calendar is fine if you're not distributing this database among numerous PCs, or if you are, that all the PCs are running the same version of Access as the PC the app is being developed in runs. Different versions of Access have different versions of the Calendar controls, and mixing them can sometimes cause problems. The same rule exists if you have any idea that you will be upgrading to a later version of Access. The code below will work with whichever type of calendar you use:

What I do for this type of thing is place a calendar control on the form, positioned as you like and set it's Visible Property to NO.

Then, using the DoubleClick property of your text box, have the calendar "popup" for date selection. You'll need to replace YourCalendarName with the actual name of your calendar, and YourTextBoxName with the actual name of your text box. You can do this for as many textboxes as you want, using the first bit of code below.

Expand|Select|Wrap|Line Numbers
  1.  Private Sub YourTextBoxName_DblClick(Cancel As Integer)
  2.   YourCalendarName.Visible = True
  3. End Sub 
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourCalendarName_Click()
  2. Screen.PreviousControl = YourCalendarName.Value  
  3.   YourTextBoxName.SetFocus
  4.   YourCalendarName.Visible = False
  5. End Sub
Now, all your user has to do is DoubleClick on the text box that will hold the date and up pops the calendar! When the user clicks on the date, the calendar disappears and the text box is populated with the date.

Linq ;0)>
Jul 10 '08 #2

Expert 100+
P: 375
Another advantage of most of these calendars is that they require *no* real estate on your form.
Jul 10 '08 #3

Expert 2.5K+
P: 3,532
I knew someone would be along with a list of alternative calendars! Can't find my list! Of course the hack above uses *no* real estate either, since the calendar "disappears" when not in use!

Linq ;0)>
Jul 11 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.