Hmm. Date is a reserved word in VBA, and so not a good idea for field names.
You may be able to get around it by adding square brackets. The report name
contains a space, it will be need square brackets in the name as well.
The code will therefore start:
strReport = "[Practice Stats]"
strField = "[Date]"
and the rest exactly as in the article.
The Debug.Print line should generate something like this for the Where
string:
[Date] > #5/5/2005#
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
ttaylor said:
Allen,
Thanks for the reply. Very helpful. I decided to also try your method 2
and
having trouble with:
Dim strReport As String 'Name of report to open.
Dim strField As String 'Name of your date field.
Dim strWhere As String 'Where condition for OpenReport.
Const conDateFormat = "\#mm\/dd\/yyyy\#"
The name of report is Practice Stats and The field name is Date. I don't
understand 'where condition from report. What should the entry look like?
Thanks