Hi - I know there are lots of posts about this but I can't get anything to work. I know I must be missing something. Here's the scenario:
I have a form that has button to call a report that is based on a table. The table that the report is based on has a field called "grade". When this button is pressed - I want to open the report and show records where grade = '1'. Here's the code I have in the ONCLICK prop of the button:
Dim stDocName As String
stDocName = "rpt_grade1-4_report_card"
strCondition = "reports!rpt_grade1-4_report_card!grade = '1'"
DoCmd.OpenReport stDocName, acPreview, , strCondition
I also tried changing strCondition to:
strCondition = "[Grade] = '1'"
But that didn't work either. I don't get an error. It just brings up the report with ALL records instead of just the ones where grade = '1'.
Any ideas???
Thanks in advance.
Caitlin
I have a form that has button to call a report that is based on a table. The table that the report is based on has a field called "grade". When this button is pressed - I want to open the report and show records where grade = '1'. Here's the code I have in the ONCLICK prop of the button:
Dim stDocName As String
stDocName = "rpt_grade1-4_report_card"
strCondition = "reports!rpt_grade1-4_report_card!grade = '1'"
DoCmd.OpenReport stDocName, acPreview, , strCondition
I also tried changing strCondition to:
strCondition = "[Grade] = '1'"
But that didn't work either. I don't get an error. It just brings up the report with ALL records instead of just the ones where grade = '1'.
Any ideas???
Thanks in advance.
Caitlin