adding pop up calendar to form (1 Viewer)

fleury

Registered User.
Local time
Yesterday, 22:03
Joined
Jul 2, 2011
Messages
27
Hello!!!
I'm newbie to access 2007 and am finding ways to adding pop up calendar(ocxCalendar) next to my combo box(cboStartDate).

After i have clicked the date in calendar, the calendar can be unhide successfully, but the problem is the combo box wont show me the date that i have clicked. Hope enthusiasts about access can help me in this project. Thanks very much!!! :)

Attached is my form.
Below are my code used for adding calendar:

Private Sub cboStartDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

ocxCalendar.Visible = True
ocxCalendar.SetFocus

If Not IsNull(cboStartDate) Then
ocxCalendar.Value = cboStartDate.Value
Else
ocxCalendar.Value = Date
End If

End Sub

Private Sub ocxCalendar_Click()
cboStartDate.Value = ocxCalendar.Value
cboStartDate.SetFocus
ocxCalendar.Visible = False
End Sub
 

Attachments

  • 2.jpg
    2.jpg
    27.2 KB · Views: 323

missinglinq

AWF VIP
Local time
Today, 01:03
Joined
Jun 20, 2003
Messages
6,423
Sorry, but this really makes any sense at all! Why in the world would you need to pick a date from a calendar and then have it show up in a Combobox? To what purpose?

Using ActiveX Calendars has always been a poor choice in Access, which is why most experienced developers have used form-based calendars, instead. And since Access 2007 added a calendar that is automatically attached to any Date/Time field, to be used to populate that field, without any code being required, that is unnecessary, in most cases.

What, exactly, are you trying to accomplish here?

Linq ;0)>
 

fleury

Registered User.
Local time
Yesterday, 22:03
Joined
Jul 2, 2011
Messages
27
yea i just wanna have one calendar which i can have select date for my cboStartDate.
When i wanna clicked on the cboStartDate, then pop up calendar will appear and i can select date from that.
Thanks very much for ur reply linq!!
 

fleury

Registered User.
Local time
Yesterday, 22:03
Joined
Jul 2, 2011
Messages
27
thanks linq for ur guidance!!! i have figured out the solution thru ur reply!!!!! :):)
 

liddlem

Registered User.
Local time
Today, 06:03
Joined
May 16, 2003
Messages
339
Hi Fleury
I read one of Bob Larson posts earlier which advises some of deprecated items in Office 2010. I seem to think that the calendar OCX was one of these. Perhaps you should reconsidder if you want to update your DB to Office2010 later.
 

Users who are viewing this thread

Top Bottom