Here's my code for creating a query criteria that is passed from a for field to a report. What am I doing wrong?
Dim stDocName As String
Dim strLinkCriteria As String
strLinkCriteria = "[Date Closed] = >#" & Me![fromDate] & "# And <#" & Me![toDate] & "#"
stDocName = "rptSterling2"
DoCmd.OpenReport stDocName, acNormal, , strLinkCriteria
I get a "Syntax error, missing operator." However if I manually put the following into the criteria field of the query then it works. ">#7/1/2001# And <#9/30/2001#" (no quotes).
Thanks in advance!
Dim stDocName As String
Dim strLinkCriteria As String
strLinkCriteria = "[Date Closed] = >#" & Me![fromDate] & "# And <#" & Me![toDate] & "#"
stDocName = "rptSterling2"
DoCmd.OpenReport stDocName, acNormal, , strLinkCriteria
I get a "Syntax error, missing operator." However if I manually put the following into the criteria field of the query then it works. ">#7/1/2001# And <#9/30/2001#" (no quotes).
Thanks in advance!