G
Guest
Hello:
I have a little script on a command button that prints the Class Attendance
sheet for the current class from a One to Many form that works great.
However, I want to add another condition to the report’s strWhere condition.
That condition is based upon a child table field: IsNull([Attend_Status])
Here’s the current script that works perfectly.
Private Sub cmdClassAttendance_Click()
On Error GoTo Err_cmdClassAttendance_Click
Dim strDocName As String
Dim strWhere As String
strDocName = "rptClassAttendance"
strWhere = "[ClassNo]= '" & Me.ClassNo & "'"
DoCmd.OpenReport strDocName, acViewPreview, , strWhere
Exit_cmdClassAttendance_Click:
Exit Sub
Err_cmdClassAttendance_Click:
MsgBox Err.Description
Resume Exit_cmdClassAttendance_Click
End Sub
-----------------------------------------------
Here’s the where condition I want to add.
-----------------------------------------------
IsNull([Attend_Status])
Additional Info:
Form Name: frmClasses
SubForm Name: sfrmClassesqrytblLink
Child Table field is [Attend_Status]
Note: Both the parent form and the subform are based upon queries. The
parent form queries tblClasses while the child form queries tblLink.
Thanks,
Robert
I have a little script on a command button that prints the Class Attendance
sheet for the current class from a One to Many form that works great.
However, I want to add another condition to the report’s strWhere condition.
That condition is based upon a child table field: IsNull([Attend_Status])
Here’s the current script that works perfectly.
Private Sub cmdClassAttendance_Click()
On Error GoTo Err_cmdClassAttendance_Click
Dim strDocName As String
Dim strWhere As String
strDocName = "rptClassAttendance"
strWhere = "[ClassNo]= '" & Me.ClassNo & "'"
DoCmd.OpenReport strDocName, acViewPreview, , strWhere
Exit_cmdClassAttendance_Click:
Exit Sub
Err_cmdClassAttendance_Click:
MsgBox Err.Description
Resume Exit_cmdClassAttendance_Click
End Sub
-----------------------------------------------
Here’s the where condition I want to add.
-----------------------------------------------
IsNull([Attend_Status])
Additional Info:
Form Name: frmClasses
SubForm Name: sfrmClassesqrytblLink
Child Table field is [Attend_Status]
Note: Both the parent form and the subform are based upon queries. The
parent form queries tblClasses while the child form queries tblLink.
Thanks,
Robert