Pop-up calendar in subform that has datasheet view?

C

CEV

I'm using a tabbed control on a form and each tab has a subform. On one of
these the subform will be viewed as a datasheet. There are only 2 fields and
one is a date field. I converted the date field text box into a combo box. I
followed the instructions from fontstuff.com to add the pop-up calendar.
When I click the drop-down to test it, I'm getting a runtime error that
says: database can't move the focus to the control ocxCalendar. I double
checked and the code looks correct with nothing mispelled. Can I still do
this even though the subform is being viewed as a datasheet? It works in my
other subforms that are regular form view. My code is listed below:

Private Sub cboDateDue_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
ocxCalendar.Visible = True
ocxCalendar.SetFocus
If Not IsNull(cboDateDue) Then
ocxCalendar.Value = cboDateDue.Value
Else
ocxCalendar.Value = Date
End If
End Sub

Thanks,
Chad
 
P

Peter Yang [MSFT]

Hello Chad,

I understand that you put the calender control in a form so that you could
show it when mousedown event occurs. However, you'd like to the form to be
in datasheet view and you receive the error message runtime error 2110:
database can't move the focus to the control ocxCalendar. If I'm off-base,
please let me know.

I was able to reproduce the issue and I think this behavior is limitation
between Access in Datasheet view and Activex control. You could try other
Activex Control and you may receive the same issue. Please see the
following link to use calendar control in a different form to work around
the issue

http://groups.google.com/group/microsoft.public.access/browse_thread/thread/
11be5b663b804fb0/28fb00a5376241a7?lnk=st&q=%22How+do+you+add+a+pop-up+calend
ar+to+an+existing%22+&rnum=1&hl=en#28fb00a5376241a7

Also, the following link is helpful:

http://www.granite.ab.ca/access/calendars.htm

Please rest assured your feedback of this limitation is routed to the
product team. Also, I suggest you can submit this feedback to our product
feedback center:
http://www.microsoft.com/office/community/en-us/wizard.mspx?type=suggestion&
lang=en&cr=US&cat=en-us-office&pt=3a4e9862-cdce-4bdc-8664-91038e3eb1e9

Please let's know if you have any comments or further feedack. Thank you.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
<http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscriptions/support/default.aspx>.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top