"Wayne-I-M" <(E-Mail Removed)> wrote in message
news:B276DB05-B81B-47B7-932D-(E-Mail Removed)...
> Hi all
>
> Is there a method to force an OnClick event on a active x calendar
control.
>
> I didn’t think this was a problem as I had set it to OnLostFocus
but a few
> users of one DB have asked that a date is displayed in an unbound
text box
> OnClick.
>
> No problem I thought. ??
>
> Even though there is an OnClick event available, nothing seems to
work
> until the calendar has lost focus.
>
> I have no problem with the coding of the event it is simply that the
OnClick
> event doesn’t seem to work.
>
> The form is set allow edits, the calendar is enabled, etc. Have
tried
> DblClick, etc. The only thing that seems to cick off an event is
> OnLostFocus, which can’t be coded eg. OnClick –
SomeThingElse.setfocus, as
> the OnClick doesn’t fire.
>
> Obviously I’m missing something here.
>
> --
> Wayne
> Manchester, England.
>
Wayne-I-M,
There is not a great deal of specific information above to go on.
I opened a blank MS Access DB.
I created a Form named frmForm1.
I drew a Calendar Control 9.0 control on the frmForm1 and named it
calCalendar
I drew an unbound text box on frmForm1 and named it txtDate
I added the following code to frmForm1's code page.
Private Sub calCalendar1_Click()
Form_frmForm1.txtDate = Form_frmForm1.calCalendar1.Value
End Sub
I ran frmForm1.
Every type I clicked on calCalendar, the txtDate's information
successfully updated with the appropriate date.
Sincerely,
Chris O.
|