View Full Version : Calendar Control


Purdue22
08-09-2001, 05:34 AM
I am having trouble getting code to work for a calendar. When I click in the text box it brings the calendar up, but when I select a date I get the error message:

Microsoft Access can't move the focus to the control Date Received(txt box).

Here is the code:

Private Sub Date_Received_Enter()
' Show Calendar and set its date.
Calendar.Visible = True
Calendar.SetFocus
' Set to today if Date Received has no value.
'Calendar.Value = IIf(IsNull(Date_Received), Date, Date_Received.Value)

End Sub

Private Sub Calendar_Click()
Date_Received.Value = Calendar.Value
Date_Received.SetFocus
Calendar.Visible = False

End Sub

Any Suggestions?

KeaganQuilty
08-09-2001, 06:00 AM
Try moving the line

Date_Received.SetFocus

AFTER

Calender.Visible = False

Keagan Quilty
Kilbride, Newfoundland