! ActiveX Calendar Control !

W

Wembly

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.

Thanks

Wembly
 
D

Dirk Goldgar

Wembly said:
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")
 

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