ActiveX Calendar (1 Viewer)

jackhot0615

Registered User.
Local time
Today, 13:33
Joined
Jan 14, 2009
Messages
10
I have a birthday field in a form, then add an ActiveX Calendar in.
I wish the birthday will update when I click the calendar, but it will update while lostfocus.

Private Sub Calendar1_GotFocus()
Me![birthday] = Me!Calendar1.Value
End Sub

How should I do?
Please help me.
 
Last edited:

DevastatioN

Registered User.
Local time
Today, 02:33
Joined
Nov 21, 2007
Messages
242
Use the on Click event for the calendar control:

Private Sub Calendar1_Click()
Me![birthday] = Me!Calendar1.Value
End Sub
 

jackhot0615

Registered User.
Local time
Today, 13:33
Joined
Jan 14, 2009
Messages
10
Hi! DevastatioN,
Thanks for your suggestion, but there are just 5 events in calendar.
On Updated
On Enter
On Exit
On Got Focus
On Lost Focus
Where can I get the On Click event in Access 2007?
 

DevastatioN

Registered User.
Local time
Today, 02:33
Joined
Nov 21, 2007
Messages
242
Sorry I was not more clear, I see now that you're correct it does not show that on the properties window.

However, open your Visual Basic Editor window for the form (where you see the Calendar_GotFocus code). On the very top you should see two pull down menus, one on the left and one on the right.

From the left pulldown, select your Calendar1 control, and on the right pulldown, select the click event. This is how you get the click event to work for your calendar report.

You could also do it on Double Click if you like, etc. Whichever you prefer.

Attached is a screenshot of what I'm talking about. Hope this helps.
 

Attachments

  • helppic.jpg
    helppic.jpg
    87.7 KB · Views: 146

Users who are viewing this thread

Top Bottom