X
xg
I have frmStudent with a subform to allow adding new record. When click this
button on the subform, newly added record is not shown in the report even
with my Me.Dirty = False.
If I close this frmStudent and return to frmMainMenu, come back, locate the
record and click this button, the newly added record would show in the
report. How to fix it? Thanks.
Private Sub cmdPreviewCourse_Click()
On Error GoTo Err_cmdPreviewCourse_Click
Dim strDocName As String
Dim strWhere As String
strDocName = "rptMyProgram"
strWhere = "(stID Is Null) OR ([stID]=""" & Me!stID & """)"
Me.Dirty = False
DoCmd.OpenReport strDocName, acPreview, , strWhere
Exit_cmdPreviewCourse_Click:
Exit Sub
Err_cmdPreviewCourse_Click:
If Err.Number = 2501 Then ' ignore cancel event error
Else
MsgBox Err.Description
End If
Resume Exit_cmdPreviewCourse_Click
End Sub
button on the subform, newly added record is not shown in the report even
with my Me.Dirty = False.
If I close this frmStudent and return to frmMainMenu, come back, locate the
record and click this button, the newly added record would show in the
report. How to fix it? Thanks.
Private Sub cmdPreviewCourse_Click()
On Error GoTo Err_cmdPreviewCourse_Click
Dim strDocName As String
Dim strWhere As String
strDocName = "rptMyProgram"
strWhere = "(stID Is Null) OR ([stID]=""" & Me!stID & """)"
Me.Dirty = False
DoCmd.OpenReport strDocName, acPreview, , strWhere
Exit_cmdPreviewCourse_Click:
Exit Sub
Err_cmdPreviewCourse_Click:
If Err.Number = 2501 Then ' ignore cancel event error
Else
MsgBox Err.Description
End If
Resume Exit_cmdPreviewCourse_Click
End Sub