Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Window will not close when using CRAXDDRT and CurrentDb.name 1

Status
Not open for further replies.
May 12, 2004
89
US
Using Crytstal Rerports 8.5 and Access 2000.

I'm trying to create a Crystal report with my current Access Database. I can add a table to the report with the code below. After that, though, I cannot close Access. The database seems to close, but the Access window itself will not go away no matter how many times I manually try to close it.

Code:
Dim CrRpt As CRAXDDRT.Report
Set CrRpt = New CRAXDDRT.Report
.
.
CrRpt.Database.Tables.Add CurrentDb.name, "MYTABLE_1"
.
.
CrRpt.SaveAs "C:\MYREPORT_1.rpt", cr80FileFormat
Set CrRpt = Nothing

The problem seems to be coming from the "CrRpt.Database.Tables.Add" line. Any clue what I'm doing wrong? Is there another way to add that table?
 
Don't know your answer, but you might try posting this to one of the Crystal Reports areas and see if someone there can help you. This is what I got when I searched for Crystal Reports forums:

Business Objects: Crystal Reports 4 Other topics
Business Objects: Crystal Reports 3 Integrate
Business Objects: Crystal Reports 1 Formulas
Business Objects: Crystal Reports 2 Data Access

---------------------------------------
The customer may not always be right, but the customer is ALWAYS the customer.
 
Did you ever get a reply to this, I am having a similar issue :-(

~Joel
As common courtesy and to help other members who might find your thread helpful in the future, please respond if the advice given resolved your issue.
 
Wait, I think I found the answer (at least to my problem)!!


It's another bug in access (a retarded one at that).



~Joel
As common courtesy and to help other members who might find your thread helpful in the future, please respond if the advice given resolved your issue.
 
I still can't figure it out, but I'll post a message if I do.

Thanks for the help!
 
Can you set a reference to the CRAXDRT library (one D)? I just used this without a problem:

Code:
Private Sub Command0_Click()

Dim crxApp As New CRAXDRT.Application
Dim crxReport As CRAXDRT.Report

Set crxReport = crxApp.NewReport

crxReport.Database.Tables.Add CurrentDb.Name, "Table1"

crxReport.SaveAs "C:\MYREPORT_1.rpt", cr80FileFormat

Set crxApp = Nothing
Set crxReport = Nothing

End Sub

-Gary
 
Try typing:
Code:
CrRpt.quit

This might fix the problem.

If not, check to see if you have any VBA or text box IF statements in the report itself referencing a boolean (true/false) control in a sub form. Similar to the sub form referencing a main form boolean expression with an If statement, a report referencing the subform will cause the same problem (this fixed my problem, just tested).



~Joel
As common courtesy and to help other members who might find your thread helpful in the future, please respond if the advice given resolved your issue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top