G
Guest
Thanking you in advance. I am a novice user so please excuse my ignorance.
I have a report based on a query. I have created a form with two text boxes
in which you select date from & date to. I have also created a command
button which calls the report wanted. My regional settings are set using
short date format dd/mm/yyyy. This seems to be causing me a problem as I get
the wrong dates etc when the report is opened. Can anyone help me to format
the date so that I can keep my regional settings as they are yet get the
right info that I need.
My code is
Private Sub CmdPrintReport_Click()
Dim ReportName
ReportName = "SettlementsRpt"
DoCmd.OpenReport _
ReportName:=ReportName, _
view:=acViewPreview, _
wherecondition:="Date Between #" & _
Me.DateFrom & "# AND #" & _
Me.DateTo & "#"
End Sub
I have a report based on a query. I have created a form with two text boxes
in which you select date from & date to. I have also created a command
button which calls the report wanted. My regional settings are set using
short date format dd/mm/yyyy. This seems to be causing me a problem as I get
the wrong dates etc when the report is opened. Can anyone help me to format
the date so that I can keep my regional settings as they are yet get the
right info that I need.
My code is
Private Sub CmdPrintReport_Click()
Dim ReportName
ReportName = "SettlementsRpt"
DoCmd.OpenReport _
ReportName:=ReportName, _
view:=acViewPreview, _
wherecondition:="Date Between #" & _
Me.DateFrom & "# AND #" & _
Me.DateTo & "#"
End Sub