Date picker trouble

R

RipperT

I am using the Microsoft Date and Time Picker Control 6.0 (SP4) with MS
Access 2002 (SP2) and it is not working. I am using the below code which
works fine until I replace the txtDate textbox with the date picker named
DTPicker9. Then, the On No Data event fires in the report. Using the same
criteria, except with a Date Picker instead of a text box.

Dim stDocName As String

stDocName = "rptInCount"
DoCmd.OpenReport stDocName, acViewPreview, , _
"(qryIncount.CountDate =
Forms![frmSelectIncountTime]![txtDate]) " _
& "and (qryIncount.CountTime =
Forms![frmSelectIncountTime]![cboCountTime])"

I'm fuzzy on the version #'s and service packs. Are they the trouble?

Many thanx,

Ripper
 
G

Guest

I would instead of the Date & Time picker use the Calendar Control 10 unless
you need to pick a specific time as well. Calendar Control only allows for a
date selection.

Create the Calendar control on your form. Add the folowing code under your
Form's on load event.
Private Sub Form_Load()
Me.Calendar0.Value = Date
End Sub

Also add the following sub:
Private Sub Calendar0_Click()
Me.txtDate = Me.Calendar0
End Sub

When you select a date on the Calendar, the txtDate will be updated with the
selected date and your code should work without any modification to it.

NOTE: Calendar Control is not part of Office but not part of the Default
installation and you might need to install it from your Office CD.
 
P

pietlinden

Personally, I'd skip the OCX nonsense altogether and use Ken Getz's one
from the Developer's Handbook or one like it. The problems the ActiveX
garbage creates just isn't worth the hassle. Sure the DTPicker is
small, but totally inconvenient if you're trying to distribute your
app. Although Ken's code at least used to erase the date in your field
if you cancelled closed the calendar without choosing a date. (I think
I fixed it by setting the calendar function's return value to default
to the existing value).
 
R

RipperT

I appreciate the responses. The calendar control feature worked nicely, but
it is not installed on all of the machines on our network and I don't have
time or resources to make it so. So, if anyone has had experience with the
ActiveX Date picker and can offer some ideas about how to make it work, I
would be most appreciative. If not, then I'll go with one of the 3rd party
offerings.

Many thanx.

R
 

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