View Full Version : ActiveX Calendar CurrentDate


Neo90815
08-17-2000, 07:32 AM
Hi,

I have an ActiveX Calendar that would not update to current date. Please help, how would I default the calendar to the current date??

Previous post shows the following code to default calendar to current date, but it does not work.

******************************************
Calendar.Value = IIf(IsNull(cal), Date, cal.Value)
*****************************************

Thanks!

gino
08-17-2000, 07:41 AM
in the onLoad or onOpen event insert this code:

me.calendar.value=date

this should work............
no if statement needed!

[This message has been edited by gino (edited 08-17-2000).]

Neo90815
08-17-2000, 07:54 AM
Sorry that did not. I placed in the OnUpdate....

Any other suggestions. I tried

'I tried the name of my ActiveX Calendar, 'this one I think make sense... NameCal..the 'value equal the date... but did not work

Me![ActiveXCtl20].Value = Date

'And I tried

Me[Calendar].Value = Date

'And I tried using the name of my Form

Me![Calendar2].Value = Date

Thanks again... any other suggesitons?

gino
08-17-2000, 07:59 AM
first of all what is the name of your calendar?

this is what i posted
"in the onLoad or onOpen event insert this code"
did you insert the code in your onLoad or onOpen event?

this will not work in the onUpdate event.

let us know if you need anymore help....

[This message has been edited by gino (edited 08-17-2000).]

Neo90815
08-17-2000, 08:16 AM
Thanks Gino!

Okay, I created a form called Calendar2. I inserted an ActiveX Calendar name [ActiveCtl23].

Under "Event" in [ActiveCtl23] Properties I have the follwing:

On Update
On Enter
On Exit
On Got Focus
On Lost Focus

That's all. I did not see On Load or On Open anywhere. I'm using Access 2000, and it's an ActiveX Calendar Version 9.0

Thanks

gino
08-17-2000, 08:23 AM
open your form properties..rather than the object itself. click on the top left box in design view of your form to open your form properties.

[This message has been edited by gino (edited 08-17-2000).]

Neo90815
08-17-2000, 09:00 AM
O My GOD!

You are wounderfulllll!!!!!

It working!!!

It did not like "On Open"... I placed the code in "On Load".

As suggestioned; In my Form Properties, "On Load" , inserted an Event Procedure code:

**********************
Me.MyCalName.Value = Date
***********************

Perfect!!!

Thanks a million!