I have a dialog form which passes a filter to a report.The reports control source is a table. When I try to pass a filter with an 'And' in the where statement of the 'Docmd.Openreport' it doesnt filter right. I want the filter to query all devices with the serial num and the date provided. Cant seem to figure out my issue.
Ex.
Case 1
...
Case 2
CalcDate = DateAdd("d", -30, Date)
DoCmd.OpenReport "Rpt_HistoryReport", reportDest, , "[SerialNum] = Forms!SearchDevice![SerialNum] And [DateSent] = " & CalcDate
etc.
I have tried changing my statement a number of ways,using ( ) and such, but cant seem to get it right for the desired result. I dont want to use a inputbox so thats out but if I did the filter does seem to work. Can someone tell me what I am doing wrong.Thanks in advance for your help!
Phil
Ex.
Case 1
...
Case 2
CalcDate = DateAdd("d", -30, Date)
DoCmd.OpenReport "Rpt_HistoryReport", reportDest, , "[SerialNum] = Forms!SearchDevice![SerialNum] And [DateSent] = " & CalcDate
etc.
I have tried changing my statement a number of ways,using ( ) and such, but cant seem to get it right for the desired result. I dont want to use a inputbox so thats out but if I did the filter does seem to work. Can someone tell me what I am doing wrong.Thanks in advance for your help!
Phil