MSCAL.calendar.7 passing data

M

Mikelj

I have a MSCAL.calendar.7 control I am using on my main form. I want
to be able to click on a date in the calendar and have it pass data
(month, day and year, if possible) to 3 text
boxes separately as in filling in the day in the day text box, the
month (as Jan, Feb etc) in the month text box and the year (as in
1999, 1998 etc) in the year text box. I'm just a beginner so any help
that you can give me will be very much appreciated.
 
G

Guest

Right click on the calender object. Select properties.
View the Events tab.
See the event types?
Ignore them. The calender is not really a proper Access control.

Instead, click on the form. Select properties.
View the Events tab.
Click on one of the event types and go into the VBA window.

In the upper left corner of the VBA document window,
you will see that the Form object is selected. Go to that
and select the calender object instead.

Now, in the upper right corner of the VBA document window,
you will see that the combo box lists the events for the calender
object. The calender object is a proper VBA com object,
even though it is not a proper Access control.

Choose one of the calender events (probably an "on update" event.)

Into the event procedure type code something like this

me.mymonth = me.mycalendar.month
me.myday = me.mycalendar.day
me.myyear = me.mycalendar.year


mymonth,myday,myyear are the names of your textboxes
mycalendar is the name of your calendar object.

all air code: you will have to try it yourself and see how
far you get.

(david)
 

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