Calendar Control Bug

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've been trying to add a the Calendar Control, in Access 2003, to a form for the past serveral days. While I can get add the calendar control, it does not change the date in the text box (assigned as the control source) properly. I just came across an MS Knowledge Base Article (# 825445), dated last August (8/28/03) that identifies this as a bug. Does MS have any plans to fix this? Ugh

Thanks

Jeff
 
Actually, I am kind of surprised they call this a bug.

Most controls do NOT update until you move the focus to the next control.
So, if you type in a new value into the company field, the value does NOT
change until you move to a new control. Hardly really a bug...and since it
worked this was for the last 3 versions....it is rather on the nice side
that it is still being called a bug.

The worked suggested however is one that I DO NOT like!

I would consider using un-bound calendar controls. In the forms on-load, I
would set the value of each calendar

me.ActMyCalStart.Value = me.StartDate
me.ActMyCalEnd.Value = me.EndDate

I would then use the after update event of the calender to set the field
value you want. Note that just like when developing in VB, the events list
is NOT available. So, while looking at the event tab of the calendar
control, you will notice that the after update event IS NOT available.
However, if you open the code window, and type in the event code...it will
work. So, use the after update event like

Private Sub ActiveXCtl14_AfterUpdate()

Me.StartDate = Me.ActiveXCtl14.Value

end sub

Or, as my example,...it would be:

Private Sub ActMyCalStart_AfterUpdate()

Me.StartDate = Me.ActMyCalStart.Value

end sub.

So, use the correct/same name you used for the control. Further, ALWAYS use
the .value property of the calendar control, since if you don't...I seen
some problems. So, always use the .value.

In most of my code examples, I actually don't place the calendar on the
form, but "pop" up a calendar. That way, I only have ONE calendar that can
service all fields. However, for things like report screens etc, the
calendar is a great little tool. Here is some screen shots of me using the
calendar...and all of the examples use the after update event. Also, all of
the example calendar are actually a sub form, as once again I only wanted
ONE copy of the calendar in the whole project.

http://www.attcanada.net/~kallal.msn/ridesrpt/ridesrpt.html
 
Hi Albert,

Thanks for the help! I am, however, a VBA newbie and now I'm lost. Couple of
questions:

1. I can create unbound Calendar control but don't understand where,
exactly, I find the forms on-load command to place the following:

me.ActMyCalStart.Value = me.StartDate
me.ActMyCalEnd.Value = me.EndDate


2. At this time, I just need one date on my form that is named MyCalendar,
would I use something like this:

me.MyCalendarAttendance.Value = me.AttendanceDate

insead of the above?

I think (?) I follow the rest of your instructions but I need a bit more
help to get started.

Thanks in advance for your help!

Jeff
 
Back
Top