Calandar control date() help (1 Viewer)

maxxximaniac

Registered User.
Local time
Yesterday, 17:37
Joined
Oct 22, 2004
Messages
80
Hey,

I'm trying to get the calendar control 10 to default to today's date when the form is loaded. I searched on it and came up with instructions to place the "Calendarcontrolname.Today" on the form load event, but its not working out. It saves the date that the control was added.

Can anyone shed some light?
Thanks!
 

selenau837

Can still see y'all......
Local time
Yesterday, 20:37
Joined
Aug 26, 2005
Messages
2,211
maxxximaniac said:
Hey,

I'm trying to get the calendar control 10 to default to today's date when the form is loaded. I searched on it and came up with instructions to place the "Calendarcontrolname.Today" on the form load event, but its not working out. It saves the date that the control was added.

Can anyone shed some light?
Thanks!

Are you using the Active X Control Calendar? Below is the code to set it to todays date.

Code:
Private Sub Form_Load()
   'set the calendar's date to today. 
me.Calendarecontrolname.Value = date
end sub


HTH, if not let me know and I shall pull out the big book once again. :D
 

maxxximaniac

Registered User.
Local time
Yesterday, 17:37
Joined
Oct 22, 2004
Messages
80
Well, I'm not quite sure if it will help, but it seemed to do the trick.

CTRL+t sets the calendar to today's date. I noticed it only works when the control has the focus.

On load event, I setfocus to the calendar, ran the control.today command and it seems to do the trick.

We'll see tomorrow...
 
Last edited:

selenau837

Can still see y'all......
Local time
Yesterday, 20:37
Joined
Aug 26, 2005
Messages
2,211
I currently use Access 2000, and use the Active X control. The code above is for that control. I have pasted my code below for future reference.

Code:
Me.clnCalendar.value = Date

Keep me updated so I can add this to my list of new things learned.
 

maxxximaniac

Registered User.
Local time
Yesterday, 17:37
Joined
Oct 22, 2004
Messages
80
Yep it looks like it worked... Set the focus to the calendar.
Run the today command then set focus somewhere else if you need. :)
 

Users who are viewing this thread

Top Bottom