Using Calendar Control

H

Howard

In a subform called Components, in a form called [Project
Data Entry] here is my code:


Private Sub Date_Required_Enter()
Me!ActiveXCalendar.Visible = True
End Sub

Private Sub Date_Required_Exit(Cancel As Integer)
Selected_Date = ActiveXCalendar.Value
Me!ActiveXCalendar.Visible = False
Forms![Project Data Entry].Components.SetFocus
Forms![Project Data Entry].Components!
DeliveredBy.SetFocus
Me![Date Required] = Selected_Date
End Sub


[Date Required] is the field in Components subform that
should obtain the value of the selected date

[DeliveredBy] is the next field in tab order after [Date
Required]

Selected-Date is a global variable of type Date

The [Date Required] field is not getting the selected date
value, but the focus does go to the [DeliveredBy] field
after selecting the date, as it should.

If I remove all the code except the two statements making
the Calendar Control visible and non-visible, then the
[Date Required] field is getting the selected date value,
as it should, but the focus goes back to the first field
in the sub-form despite the tab order.

The Calendar control is bound to the [Date Required] field.

Please Help! Thanks - Howard
 

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