Datareport - Failed getting Rowset(s) from current data source error is produced when I want to print the report two times.

Posted on 2004-10-26
Medium Priority
Last Modified: 2012-08-14
I have a form that has two buttons on it: Print Preview and Print.
When I print preview this datareport it works fine. I can close the preview window and click Print Preview again to see it as many times as I wish.
If I click on the Print button, the complete report (All pages) prints out fine.
The problem occurs if I click on the Print button again in order to print out multiple reports, I get the following error: Failed getting Rowset(s) from current data source?

Private Sub butPrintPreview_Click()
        deEstimations.cmdHeader frmEstimationDesc.currentItem
        rptNoteFr.WindowState = 2
        rptNoteFr.Show vbModal, Me
        Set deEstimations = Nothing
End Sub
Private Sub butPrint_Click()
        deEstimations.cmdHeader frmEstimationDesc.currentItem
        rptNoteFr.WindowState = 2
        rptNoteFr.PrintReport (False)
        Set deEstimations = Nothing
End Sub

I don't know why it is doing this.
My Print Preview button works fine as many times as I would like it to. But not my Print button function?
Question by:dcprog
  • 2
LVL 14

Accepted Solution

Shiju Sasidharan earned 750 total points
ID: 12414317
Try by removing the statement
>>Set deEstimations = Nothing

Assisted Solution

by:Ashutosh Vyas
Ashutosh Vyas earned 150 total points
ID: 12419398
Set deEstimations = Nothing

sets deEstimations to Nothing and therefore deEstimations.cmdHeader frmEstimationDesc.currentItem
is noting and hense you get the error.

Author Comment

ID: 12423509
Sorry guys.

I tried removing the Set deEstimations = Nothing. The error is still occuring. What I don't understand is that the PrintPreview button works fine and it is basically the same? I never get that errror when I preview?

A little more info on my DataEnvironment:

        1 DataEnvironment  (Mostly default settings)
        Name -> deEstimations

1 DEConnection (Mostly default settings)
        Name -> conEstimations
        CommandTimetout -> 30
        ConnectionSource -> Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Estimations\DONNEE95.MDB;Persist Security Info=False
        ConnectionTimeout -> 15
        CursorLocation -> 3 - adUseClient
        DesignPromptBehaviour -> 2 - adPromptComplete
        DesingSaveAthentication -> False
        RunPromptBehaviour -> 2 - adPromptComplete
        RunSaveAuthentication -> False

Many Commands and Child Commands
        All commands are based on an sql statement and have many child commands.

Could this error be occuring because of these settings? Again I wouldn't understand why since the PrintPreview works fine.

Let me know if you need more info.

Author Comment

ID: 12425380
You guys were partially right about removing the Set deEstimation = Nothing statement.
By removing this it still didn't work but after trying some stuff I discovered if add deEstimations.conEstimations.Open at the beginning of my command it worked.

I did the same for my PrintPreview command. Now everything seems to be working fine.


Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question