J
JohnLute
I'm experiencing a database close-down whenever I execute a preview and print
button. Upon execution a dialog box pops up: "MS Access has encountered a
problem and must be closed."
I've reviewed the preview button code and don't see any problems. Does
anyone see any:
Private Sub Preview_Click()
On Error GoTo Err_Preview_Click
Dim strDocName As String
Dim stLinkCriteria As String
'Check to see that ending date is later than beginning date.
If IsDate(BeginningDate) And IsDate(EndingDate) Then
If EndingDate < BeginningDate Then
MsgBox "The ending date must be later than the beginning date."
SelectDate.SetFocus
Exit Sub
End If
Else
MsgBox "Please use a valid date for the beginning date and ending
date."
Exit Sub
End If
strDocName = Me!SelectReport
If strDocName = "Complaint Rate Chart" Then
DoCmd.OpenForm "MsgBoxComplaintRateChart", , , stLinkCriteria
Else
DoCmd.OpenReport strDocName, acPreview
End If
Exit_Preview_Click:
Exit Sub
Err_Preview_Click:
If Err = ConErrRptCanceled Then
Resume Exit_Preview_Click
Else
MsgBox Err.Description
Resume Exit_Preview_Click
End If
End Sub
Thanks for your help!!!
button. Upon execution a dialog box pops up: "MS Access has encountered a
problem and must be closed."
I've reviewed the preview button code and don't see any problems. Does
anyone see any:
Private Sub Preview_Click()
On Error GoTo Err_Preview_Click
Dim strDocName As String
Dim stLinkCriteria As String
'Check to see that ending date is later than beginning date.
If IsDate(BeginningDate) And IsDate(EndingDate) Then
If EndingDate < BeginningDate Then
MsgBox "The ending date must be later than the beginning date."
SelectDate.SetFocus
Exit Sub
End If
Else
MsgBox "Please use a valid date for the beginning date and ending
date."
Exit Sub
End If
strDocName = Me!SelectReport
If strDocName = "Complaint Rate Chart" Then
DoCmd.OpenForm "MsgBoxComplaintRateChart", , , stLinkCriteria
Else
DoCmd.OpenReport strDocName, acPreview
End If
Exit_Preview_Click:
Exit Sub
Err_Preview_Click:
If Err = ConErrRptCanceled Then
Resume Exit_Preview_Click
Else
MsgBox Err.Description
Resume Exit_Preview_Click
End If
End Sub
Thanks for your help!!!