cal control - default date

S

SAC

I would like to set the default date for the cal control to today.

I've placed the cal control on a form and on the form's open event I put in:

objCalControl.Value = Date()

But this isn't changing anything.

What do I need to do?

Thanks.
 
W

Wayne Morgan

Try it without the (). Is objCalControl the name you gave to the calendar control?
 
V

Van T. Dinh

Try the Current Event.

I found that setting the value of the Calendar Control doesn't work until
the Current Event (tested in A2K).

If you want, you can use the Today Method of the Calendar Control which
works from the Form_Open Event.
 
V

Van T. Dinh

Don't know why but setting the value for the Calendar
Control doesn't work until Current Event om my PC (tested
on 2 different Forms in A2K).

Van T. Dinh
MVP (Access)


-----Original Message-----
It works using the On Load event of Access 97, 2000 and 2002 on my
machine.

RDH



------------------------------------------------
 
S

SAC

Thanks, the on current event did it for me.


Van T. Dinh said:
Try the Current Event.

I found that setting the value of the Calendar Control doesn't work until
the Current Event (tested in A2K).

If you want, you can use the Today Method of the Calendar Control which
works from the Form_Open Event.
 
S

SAC

Thanks. Now I can use either the on_load or the current!

Seems odd that on_open wouldn't work.

I appreciate it the help.
 
L

Laurie

RDH -

You are a life saver. I was having the same issue and moved my code from the OnOpen to the Load event and now it works! Thank you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top