X
xg
I want to preview a report from a form which display current record. My
conditions are: either current stID, or stID is blank
However, my report only shows current stID, but not records with stID is
blank. Where did I do wrong?
Private Sub cmdPreviewCourse_Click()
On Error GoTo Err_cmdPreviewCourse_Click
Dim strDocName As String
Dim strWhere As String
strDocName = "rptMyProgram"
' This line is the problem
strWhere = "[stID]=""" & Me!stID & """ or [stID]= ""Is Null"""
DoCmd.OpenReport strDocName, acPreview, , strWhere
Exit_cmdPreviewCourse_Click:
Exit Sub
Err_cmdPreviewCourse_Click:
MsgBox Err.Description
Resume Exit_cmdPreviewCourse_Click
End Sub
conditions are: either current stID, or stID is blank
However, my report only shows current stID, but not records with stID is
blank. Where did I do wrong?
Private Sub cmdPreviewCourse_Click()
On Error GoTo Err_cmdPreviewCourse_Click
Dim strDocName As String
Dim strWhere As String
strDocName = "rptMyProgram"
' This line is the problem
strWhere = "[stID]=""" & Me!stID & """ or [stID]= ""Is Null"""
DoCmd.OpenReport strDocName, acPreview, , strWhere
Exit_cmdPreviewCourse_Click:
Exit Sub
Err_cmdPreviewCourse_Click:
MsgBox Err.Description
Resume Exit_cmdPreviewCourse_Click
End Sub