changing the date in a calender control.

G

Guest

Hi,

I've got a calender (calender control 8.0) on my form. But the date on it
doesn't change. It stays at the date when i putted it on my form.

How can i make it so that everytime i open this form, the calender begins at
the current day.

me.calender2.value = date doesn't work

The same if i use the monthview.
 
V

Van T. Dinh

The statement should work fine.

I have a similar statement:

Me.acxCalendar.Value = Date

in the Form_Current Event and it worked fine.

In addition, the Calendar Control (at least in Calendar 10 which I checked)
has the method Today which you can use to set the value of the Calendar
Control to today's date.
 
G

Guest

The statement should work fine.
I have a similar statement:

Me.acxCalendar.Value = Date

in the Form_Current Event and it worked fine.

In addition, the Calendar Control (at least in Calendar 10 which I checked)
has the method Today which you can use to set the value of the Calendar
Control to today's date.

Thanks,

I have replaced the calender object to a new one without rename it, and it
works now.
 
R

RD

Hi,

I've got a calender (calender control 8.0) on my form. But the date on it
doesn't change. It stays at the date when i putted it on my form.

How can i make it so that everytime i open this form, the calender begins at
the current day.

me.calender2.value = date doesn't work

The same if i use the monthview.

I found the MS DateTime Picker to be a PITA to use. I ended up just putting a
good input mask on on a text box. If you really want to use a date picker try
this one from Brendan Kidwell. It's pretty sharp and works well.

http://www.glump.net/dokuwiki/software/microsoft_access_date_picker

HTH,
RD
 
G

Guest

I use the calendar control with no problems. You have to set the focus to the
calendar to assign a value to it, and have to reference it as
Cal.Object.Value. Here's an example, where my Calendar control is called
calDOS (curDate is a field I defined in my app that is set to the current
date):

calDOS.SetFocus
calDOS.Object.Value = curDate + 1

Also, if you want to use a calendar's events, only a small number of them
show up by default in the code window. I ended up having to create an event
called CalDOS_AfterUpdate to trigger an event after the value is changed -
the drop-down list of events for the calendar control doesn't show
AfterUpdate or BeforeUpdate by default for some reason. Once you add it
yourself it will show up in the drop-down list.
 
G

Guest

Thanks Jim. So simple when you get a clue! We have struggled with this for
2 hours - and we had it working on another form - don't know why!
Cheers
Stephen
 

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