Date Control (1 Viewer)

gregorg

Registered User.
Local time
Today, 20:36
Joined
Jul 26, 2006
Messages
56
Hi I have a date control and on the Click event I run the following code.
Trouble is the Date Control stops working, ie you can't change the date after one click ?

CODE.

Private Sub Calendar7_Click()


weekofyeartxt.Value = DatePart("ww", Calendar7.Value)


End Sub

Thanks.
 

missinglinq

AWF VIP
Local time
Today, 15:36
Joined
Jun 20, 2003
Messages
6,420
  • What version of Access are you running?
  • What kind of DatePicker are we talking about? ActiveX Control? Form-based? Third-party Control?
  • I would try running the code from the AfterUpdate event, rather than from the OnClick event. The OnClick events of Controls are frequently notoriously fickle, not firing when you would expect them to:
Code:
Private Sub Calendar7_AfterUpdate()
  Me.weekofyeartxt.Value = DatePart("ww", Me.Calendar7.Value)
End Sub
Linq ;0)>
 

gregorg

Registered User.
Local time
Today, 20:36
Joined
Jul 26, 2006
Messages
56
Hi its a MSCAL.Calendar.7 Calendar Control 12.0 and it stop working for date picking with no code behind the event at all ? Can you download better controls ?

It is Access 2007.
 

missinglinq

AWF VIP
Local time
Today, 15:36
Joined
Jun 20, 2003
Messages
6,420
There are many, many threads here, and elsewhere, concerning problems with using these calendars with Versions 2007 and later. Why aren't you using the native DatePicker? By default, when entering a Control that is Bound to DateTime Field, a small calendar icon appears next to the Control. Click on it and the calendar pops up. You can even automate it so that the calendar pops up when you enter the Control.

Linq ;0)>
 

Users who are viewing this thread

Top Bottom