"Wembly" <(E-Mail Removed)> wrote in message
news:04ea01c3a74d$99b51e10$(E-Mail Removed)
> Hi,
>
> Please disregard my previous post.
>
> When a text field is double clicked, it loads the calendar
> form, which contains an ActiveX calendar control.
>
> I was wondering if the following can be done in the
> calendar form, when the user double clicks on the
> calendar. I want to return the date to the text field:
>
> dim currentForm as Form
> dim currentControl as Control
>
> set currentForm = screen.activeForm
> set currentControl = screen.activeControl
>
> With currentForm
> !currentControl = Format(Me.acxCalendar, "Short Date")
> End With
>
> The way it is at the moment, an error msg says that it
> cannot find the field "currentControl" referred to in the
> expression.
That's because currentControl is the name of a Control object, not the
name of a control on the form. But it's redundant anyway. Just write
Screen.ActiveControl = Format(Me.acxCalendar, "Short Date")
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)