Hi Micheal,
It already does.
The Master / Child link (MyCal/ApptDate) "automagically" inserts the date
currently selected on the calendar into the ApptDate field in a new record
in the subform, which is likely by design -- in order to preserve the
integrity of the link.Changing the date on the calendar changes the date in
the subform, too.
I believe that the problem is that the "Private Sub MyCal_Updated(Code As
Integer)" event is probably NOT firing and NOT requerying the subform. You
could set a breakpoint and check if you like, but that's why I use the
AfterUpdate event.
Yes, that's right, the AfterUpate event ... the code below (from my previous
reply) was NOT a typo on my part...
I realize that the ActiveX calendar doesn't show AfterUpdate in its own
property sheet, but if you look in the code window ... it's there AND it
works. My theory is that the ActiveX Calendar becomes a member of the Form's
Control Collection and therefore "inherits" some new events.
(I do a lot of things knowing THAT they work, and not really caring WHY they
work! <grin> )
Private Sub MyCal_AfterUpdate()
Me.sbfAppointments.Requery
End Sub
So anyway, change the event, then have another look... tell me if I'm wrong.
:)
Don
"Lumpierbritches" <lu*************@aol.com> wrote in message
news:20***************************@mb-m06.aol.com...
I have a Calendar control (me.mycal) and a subform sbfAppointments, with
child/parent links from Parent/MyCal (ActiveX) to Child/ApptDate in the
subform sbfAppointments.
I would like to be able to click on a dat in the MyCal control and add it
to the subform sbfAppointments. Any help would be greatly appreciated.
Here is code:
Option Compare Database
Option Explicit
Private Sub Form_Load()
Me.MyCal = Date
End Sub
Private Sub MyCal_Updated(Code As Integer)
Me.sbfAppointments.Requery
End Sub
Thank you,
Michael