Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

618 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