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

Calendar Active X Control

P: 2
I have a simple form in Access 2003 which includes a date field. I have added the Calendar ActiveX Control and set the ControlSource to the date field. When I select a date in the calendar, the date does not change automatically in the field unless i click back on it. What should I do so the date selected in the calendar control is immediately shown in the field.
Nov 12 '06 #1
Share this Question
Share on Google+
8 Replies


missinglinq
Expert 2.5K+
P: 3,532
We need to know where you assigned the calendar value to your field and see your code.
Nov 12 '06 #2

P: 2
All I have done is add the calendar to a form which is bound to the table with the date field and then bound the Control Source property of the calendar to the date field on the form. I have not added any code
Nov 12 '06 #3

ADezii
Expert 5K+
P: 8,607
I have a simple form in Access 2003 which includes a date field. I have added the Calendar ActiveX Control and set the ControlSource to the date field. When I select a date in the calendar, the date does not change automatically in the field unless i click back on it. What should I do so the date selected in the calendar control is immediately shown in the field.
The Date will appear in the Field only when the Current Record has been saved by any appropriate method. Once Saved - the Date Field will immediately become visible with the value drawn from the Calendar Control.

Hope this helps...
Nov 12 '06 #4

missinglinq
Expert 2.5K+
P: 3,532
Are you saying that in the Control Source Property for your text field you've set it = [YourCalendar] ?
Nov 12 '06 #5

missinglinq
Expert 2.5K+
P: 3,532
Copy the following code, go into your VB Editor (from Design View, <Control> + <G>) and paste the following code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourCalendar_Click()
  2.     [DateTextBox] = YourCalendar.Value
  3. End Sub
You'll need to substitute your actual names for YourCalendar and DateTextBox. Now, as soon as you click on a date, it will appear in your text box and be saved when the record is saved.
Nov 12 '06 #6

NeoPa
Expert Mod 15k+
P: 31,263
I think using Ctrl-G here will cause problems.
That will take you to the immediate pane where procedures cannot be defined.
Put it in the code area and you'll be fine.
Nov 12 '06 #7

missinglinq
Expert 2.5K+
P: 3,532
NeoPa's exactly right! Had a brain fart! The code goes into the code area! Goto View->Code and paste the code in! Thabks NeoPa!
Nov 12 '06 #8

NeoPa
Expert Mod 15k+
P: 31,263
NeoPa's exactly right! Had a brain fart! The code goes into the code area! Goto View->Code and paste the code in! Thabks NeoPa!
What a wonderfully colourful expression.
I have 'Senior Moments' ;)
(unfortunately a lot of the time.)
Nov 12 '06 #9

Post your reply

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