Calendar Control

Purdue22

Registered User.
Local time
Today, 22:25
Joined
May 11, 2001
Messages
25
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?
 
Try moving the line

Date_Received.SetFocus

AFTER

Calender.Visible = False

Keagan Quilty
Kilbride, Newfoundland
 

Users who are viewing this thread

Back
Top Bottom