I am trying to use vb code to specify a filter that a report is opened with. So strfilter is what I use in the docmd.openreport, however I can't figure out how the string is supposed to look. What I have is...
So basically it takes what the user has entered in a field called txtFiscalYear, and uses that to create a range of dates. However, its giving me errors, I think because of the way I have written it. Can any of you coding gods help me out with this? Thanks.
Code:
strfilter = strfilter & " tblData.[RR DATE] BETWEEN 10/31/'&Me.txtFiscalYear-1&' AND '&09/30/&Me.txtFiscalYear&'"
So basically it takes what the user has entered in a field called txtFiscalYear, and uses that to create a range of dates. However, its giving me errors, I think because of the way I have written it. Can any of you coding gods help me out with this? Thanks.