I
injanib via AccessMonster.com
I have a command button called TodaysReport and an unbound textbox called
txtDate whos defauld value is set to Date(). I need the on click event
property of the button to filter the report only for the records whos dates
are the same as that in the textbox. The name of field in the record source
of the report is [ReceivedOn]. This works perfectly with any other data type,
but not with the date/time data type. I get a blank report everytime. The
format and input mask of the date in all three controls meaning on the report,
record source and unbound textbox are the same. Why do I get a blank report???
?? here is my code.
Private Sub TodaysReport_Click()
Dim stDocName As String
Dim strWhere As String
stDocName = "Report"
strWhere = "ReceivedOn=#" & Me.txtDate & "#"
DoCmd.OpenReport stDocName, acPreview, , strWhere
End Sub
txtDate whos defauld value is set to Date(). I need the on click event
property of the button to filter the report only for the records whos dates
are the same as that in the textbox. The name of field in the record source
of the report is [ReceivedOn]. This works perfectly with any other data type,
but not with the date/time data type. I get a blank report everytime. The
format and input mask of the date in all three controls meaning on the report,
record source and unbound textbox are the same. Why do I get a blank report???
?? here is my code.
Private Sub TodaysReport_Click()
Dim stDocName As String
Dim strWhere As String
stDocName = "Report"
strWhere = "ReceivedOn=#" & Me.txtDate & "#"
DoCmd.OpenReport stDocName, acPreview, , strWhere
End Sub