Using AxDate Control

E

everettwelch

I'm constructing a form and wish to use the AxDate Control to select
date and set the value of a control source. Code on the control's O
Updated event similar to this:

Me.ScheduledStart.Value = Me.AxDateScheduledStart.Value

Does not get the intended result.

Can anyone help guide me in the correct direction?

Thanks
 
W

Wayne Morgan

I'm not familiar with the AxDate Control. Have you verified that the Updated
event is firing? To do this, try placing a MsgBox command before the line of
code that you have. Do you get the message box popping up when you click the
control to update it?

You say you placed this in the control's "On Updated" event. The "On
Updated" is where you place what to run, an event procedure or macro. You
don't place the code here. The item should be set for [Event Procedure] then
click the ... button to the right of the box and place your code in the
event procedure that opens in the code editor.
 
E

everettwelch

Thanks Wayne.

I can see how my message was not clear and I appreciate your reply.

The code line I included in the original message is placed in the su
for the On Updated event. Using your recommendation to include
msgbox call in the same sub I can see the event is not triggered b
selecting a date from the control. Not sure what On Updated is for.

Remaining events of the control are On Enter, On Exit, On Got Focus an
On Lost Focus. Each seamingly ambiquous for my intent. I simply wan
the selected date entered to the target object.

I'm imagining passing the target object name to a separate for
containing the AxDate Control and passing it back when the modal for
is closed. This seems like complex overkill though (again I'll need t
get the value selected).

Still baffed.

v/r
Everet
 
W

Wayne Morgan

If by AxCalendar, you mean the calendar control that comes with Access, here
is a note from the Help file:
-------------------------------------
The Calendar control included with Microsoft Access 97 no longer supports
the Updated event. If you convert a database that includes the Calendar
control from a previous version of Microsoft Access to Microsoft Access 97,
you should move any code in the Updated event of the Calendar control to the
AfterUpdate event.
-------------------------------------
While the AfterUpdate event doesn't show on the Events tab of the
Properties, I created the following in the code window for the form and it
did work.

Private Sub Calendar0_AfterUpdate()
MsgBox "Test AfterUpdate"
End Sub
 
E

everettwelch

Wayne,

This control is definitely named AxDate and it is not the Calenda
Control.

The Calendar Control is a beast. This control AxDate (either fro
AxCtrl32 OLE control module, or Microsoft ActiveX Data Objects 2.
Library; these being set references in vba) is much more compact an
cleaner in operation
 
W

Wayne Morgan

It may still be worth while seeing what happens if you manually create an
AfterUpdate event for the control in the form's code module. It'll either
work or it won't.
 
E

everettwelch

Microsoft Date And Time Picker Contro. 6.0 (SP4) works just fine and yo
can set the control source. No coding required
 
Top