The # delimiter is needed around the date values, not around the field name.
Also, if you use the square brackets, they must go around the query name and
field name separately.
Add this line after yours:
Debug.Print strWhere
Then when it runs, open the Immediate Window (press Ctrl+G) and see what
came out. Your goal is to create a string like this:
[Query1].[Field1] Between #1/1/2005# And #1/1/2006#
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Reply to group, rather than allenbrowne at mvps dot org.
accessdesigner said:
strwhere = strwhere & "#[queryname.fieldname]# Between " & "#" &
Me.BegDate &
"#" & " And " & "#" & Me.EndDate & "#"
I'm trying to read a date field in a query from a combo box statement....