I want to open a report showing records between two dates. I have a form where I input the dates by choosing in the calendar that pops - up. I have the following code:
Private Sub cmdViewReport_Click()
DoCmd.OpenReport "rptKondisjon", acViewPreview, , "TheDate Between " & "#" & Me.txtStart & "#" & " AND " & "#" & Me.txtSlutt & "#"
However, when I click the following error message pops up.
"Syntax error in date in query expression" Please see attachment for further details.
Date format: 07.04.2009 means 7th of April 2009. This format is what comes up when I choose the date in the calendar, and also is the format that is displayed in the table.
Please suggest me how to solve this.