Stuart Sanders
stuart at pacific.net.hk
Tue Nov 18 06:43:39 CST 2003
I don't use crystal reports, but I'll take a stab and suggest that you may need to terminate the instance of crystal reports. If its embedded, I'm not really sure what you'd need to do, but for called objects you usually need to do something the following when you close the form: Set object = nothing So try Set CrystalReport3 = nothing In your form close event, and if that fails you may need to lookup your documentation on how to close it. Stuart > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Paula Wright > Sent: Tuesday, 18 November, 2003 8:28 PM > To: accessd at databaseadvisors.com > Subject: [AccessD] Problems closing XP > > > 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 > > > _______________________________________________ > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com >