[AccessD] Problems closing XP

Paula Wright paulawright at boddienoell.com
Tue Nov 18 06:28:03 CST 2003


I have an Access XP database calling Crystal Reports 8.5.  I am desparate -
I've looked everywhere I can think of and still no answers.  
 
I have a crystl32.ocx embedded in my subform.  The main form is a
switchboard.  The problem is that the database will not shut down without
using CTRL-ALT-DEL after calling a Crystal Report.  I can open any subform
(including the subform with the ocx) and close without problems, but as soon
as I call the CR I have a problem shutting down.
 
I call Crystal Reports from the subform.  Here is a sample code:
 
Private Sub PNL_Recap_Click()
On Error GoTo Err_PNL_Recap_click
Set db = CurrentDb
Set rs = db.OpenRecordset("Page 1 Report")
If rs![Month1 Occupancy] > 0 And rs![Month1 ADR] > 0 Then
DoCmd.Hourglass True
    Select Case Me.SelectRpt
        Case 1
            CrystalReport3.ReportFileName = "c:\Hotel Management
System\page1.rpt"
        Case 2
            CrystalReport3.ReportFileName = "c:\Hotel Management System\page1
$.rpt"
        Case 3
            CrystalReport3.ReportFileName = "c:\Hotel Management System\page1
Totals.rpt"
        Case 4
            CrystalReport3.ReportFileName = "c:\Hotel Management
System\page1Y.rpt"
    End Select
 
        CrystalReport3.Destination = 0
        CrystalReport3.WindowState = 2
        CrystalReport3.Action = 1
 
        DoCmd.Hourglass False
Else
    MsgBox "You must fill out fields in ADR/Occupancy."
End If
 
Set rs = Nothing
 
Exit_PNL_Recap_click:
    Exit Sub
Err_PNL_Recap_click:
    MsgBox Err.Number & " " & Err.Description & " /PNL_Recap_Click"
    Resume Exit_PNL_Recap_click
End Sub
 
At first I was able to take the focus off the subform before shutting down
and that seemed to work, however that no longer works.  I've been told that
it may not actually be the CR causing the problem but something else.  The
problem is that it seems to work fine except when I open the CR.  That seems
to indicate that something is left hanging, but I don't know what and I don't
know how to close the CR programmatically.
 
Thank you
Paula Wright
 
 


More information about the AccessD mailing list