Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ActiveX calendar control in 97 - how is value updated?

19 views
Skip to first unread message

MLH

unread,
Jun 1, 2005, 11:59:35 AM6/1/05
to
I have code below in the OnUpdated property setting
for the ActiveX control. However, when I left click a
new date on the calendar in an open form, the code
does not run (IE, msgbox does not display). What am
I doing wrong?

Private Sub ActiveXCtl9_Updated(Code As Integer)
MsgBox "After Updated event fired for ActiveXCtl9"

End Sub

jimfo...@compumarc.com

unread,
Jun 1, 2005, 2:25:25 PM6/1/05
to

The ActiveX calendar control in A97 has an AfterUpdate event. Perhaps
that will accomplish what you need. On my Form_Load event I do
something like:

txtBeginDate = Format(DateAdd("d", -6, Now()), "m/d/yy")
ActiveXBegin.Value = CDate(txtBeginDate)
txtEndDate = Format(Now(), "m/d/yy")
ActiveXEnd.Value = CDate(txtEndDate)

where tbxBeginDate and txtEndDate are locked. Then

Private Sub ActiveXBegin_AfterUpdate()
txtBeginDate = CStr(ActiveXBegin)
End Sub

Private Sub ActiveXEnd_AfterUpdate()
txtEndDate = CStr(ActiveXEnd)
End Sub

so that clicking on the ActiveX control puts the date into the
appropriate text box. I know the dates are always valid. Using just
the ActiveX controls has caused confusion for the users in situations
such as changing the month but not clicking on the day. The textboxes
show them exactly what dates will be used.

James A. Fortune

0 new messages