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.
"RipperT [ at ]comcast.net>" wrote:
[Quoted Text] > 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 > > >
|