Calendar Controls in Access 2002: MSCAL.Calendar.7

G

Guest

I've tried this code in all five Event properties of this control (On
updated, Exit, Enter, Focus, Lost Focus):

msgbox "does this work"

And then I go start the form that the calendar is on, and click with wild
abandon on various calendar dates.

The msgbox never comes up. Does anyone know what it takes to make anyhese
vents fire?
 
G

Guest

Hi

You could use the GotFocus event, something like

Private Sub CalendarName_GotFocus()
MsgBox "Hi this is a message", vbOKOnly, "This is the title of the
message"
End Sub
 
G

Guest

Maybe I didn't make it clear. I've already put code in all 5 of the 5
choices presented to me under the EVENTS TAB for the properties of this
control.

The ones that I see listed are:

On Uupdated
On Exit
On Enter
On Got Focus
On Lost Focus

In fact, I put the Msgbox "Fired?" in all 5 at once, start the form, click
on different dates on the calendar, am even able to get the calendar to fill
in other text boxes, like:

Me.txtStartDate = Me.MyCalendar.value

But NONE of the 5 events EVER gets triggered.
 
G

Guest

I don't have On Click on my EVENTS TAB, I only have the following:

On Uupdated
On Exit
On Enter
On Got Focus
On Lost Focus

In fact, I put the Msgbox "Fired?" in all 5 at once, start the form, click
on different dates on the calendar, am even able to get the calendar to fill
in other text boxes, like:

Me.txtStartDate = Me.MyCalendar.value

But NONE of the 5 events EVER gets triggered no matter how much I click,
change dates, click the year dropdown, click the month dropdown.

Any help is appreciated.
 
G

Gina Whipp

You know that's probably why I don't use that control (at least one of the
many reasons). Anyway, sorry I don't know how to make a message box pop-up
when clicking a date on that control.

Allen Browne has a calendar available at: http://allenbrowne.com/ser-51.html
perhaps it will offer options you can work with.

HTH,
Gina Whipp
 
G

Guest

Hi,
I know it's a little while since you posted this, but I came across it when
I was looking to solve a similar problem. Having looked through many calendar
postings I finally was educated how to make this work.

Open code editor window and open the left-side combo box at the top of the
code window. This displays a list of objects on the form. Choose the name of
your calendar (in this example ocxCalendar), then open the right-side combo
box to display a list of procedures and choose Click. This prompts the editor
to create the first and last lines of the calendar's click event procedure...
enter your code msgbox "Does This Work" here and you should be ok.

I just tested it before I wrote this and it works every time you click on a
new date.

If you've already resolved this - great - if not this should do it for you.

Dave C
 
M

missinglinq via AccessMonster.com

Yeah, this is one of Access' many quirks; the On_Click doen't show in the
Properties Box but it does in the Code Editor! As my friend from Jersey says,
"Go figure!"
 

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