I hope I can describe this correctly.
I want a user to be able to select criteria from drop down boxes on a form. (TestID and Teacher). I can get the required results but not without generating an error message "Object Required", which is referring to the Reports object. Here is the piece of code.
Dim strType As String
Dim strTeacher As String
strType = "TestName = (Forms!frmReport!cboTestID)"
strTeacher = "ABBREVNAME = (Forms!frmReport!cboTeacher)"
Dim strSQL As String
strSQL = "SELECT Students.TESTID, Students.ABBREVNAME FROM Students WHERE TESTID = strType AND ABBREVNAME = strTeacher"
docmd.OpenReport "HighPartProfLowProfbyTeacher", PrintMode ', , strTeacher
Reports!HighPartProfLowProfbyTeacher].Filter = strSQL
Reports!HighPartProfLowProfbyTeacher].FilterOn = True
Any help would be appreciated.
I want a user to be able to select criteria from drop down boxes on a form. (TestID and Teacher). I can get the required results but not without generating an error message "Object Required", which is referring to the Reports object. Here is the piece of code.
Dim strType As String
Dim strTeacher As String
strType = "TestName = (Forms!frmReport!cboTestID)"
strTeacher = "ABBREVNAME = (Forms!frmReport!cboTeacher)"
Dim strSQL As String
strSQL = "SELECT Students.TESTID, Students.ABBREVNAME FROM Students WHERE TESTID = strType AND ABBREVNAME = strTeacher"
docmd.OpenReport "HighPartProfLowProfbyTeacher", PrintMode ', , strTeacher
Reports!HighPartProfLowProfbyTeacher].Filter = strSQL
Reports!HighPartProfLowProfbyTeacher].FilterOn = True
Any help would be appreciated.