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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CR9 delayed with Access2000 tables

Status
Not open for further replies.

Periko

Programmer
Feb 24, 2003
134
BE
Hello,

I'm using VB6 with access2000 and CR9. In VB, i'm calling a form on which my printpreview is shown. To print, i'm using a query to get the data from the database, store this to a temp database, where I store all my data to print. In vb, i'm do this query and call the print-form. sometimes my printform shows me an empty preview. After pressing the refresh-button a few times, my data appears in the printform. It's like the printform is executed before my temp-table is filled up. Anyone had this problem ?

Pedro...
 
What code are you using to open the report?

-dave
 
hello,

I put here a piece of my code...

Set Appn = CreateObject("CrystalRunTime.application")
Set cReport = Appn.OpenReport(DCMenuPath & "stockgl.RPT")

cReport.Database.Tables(1).Location = TempMdb
cReport.VerifyOnEveryPrint = True


cReport.FormulaFields.GetItemByName("Type").Text = Chr(34) & Me.Txt_Type & Chr(34)

cReport.FormulaFields.GetItemByName("Dia").Text = Chr(34) & Me.Txt_Dia & Chr(34)

cReport.FormulaFields.GetItemByName("GKleur").Text = Chr(34) & Me.Txt_Kleur & Chr(34)

PrintIt.CRViewer.ReportSource = cReport
PrintIt.Show vbModal
Set cReport = Nothing


Is this what you asked for ?

Thx...
Pedro...
 
Try calling the DiscardSavedData method before setting the Location:

cReport.DiscardSavedData

This could also be some kind of timing issue between adding the records to the temp table then trying to report on it. I've worked on Access projects using Access reports that worked that way, but I've not done that with Crystal vs. Access.

-dave
 
Nope, does not help a bit !

Thx anyway...

Pedro...
 
Are you creating a recordset in VB and dumping the results into Access? If so, you might take the temp table out of the equation, and send the recordset straight to the report instead. If you're using an OLEDB connection, I'm pretty sure CR 9 uses the same driver for ADO, so you wouldn't have to monkey with the report - you'd just call the SetDataSource method to send the recordset to the report.

This sample app might help if you want to go that route:
Microsoft Visual Basic application using the RDC with ADO

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top