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

x
?
Solved

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
4
Medium Priority
?
668 Views
Last Modified: 2012-08-14
Problem:
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?

Code:
Private Sub butPrintPreview_Click()
        deEstimations.cmdHeader frmEstimationDesc.currentItem
        rptNoteFr.WindowState = 2
        rptNoteFr.Show vbModal, Me
        deEstimations.conEstimations.Close
        Set deEstimations = Nothing
End Sub
Private Sub butPrint_Click()
        deEstimations.cmdHeader frmEstimationDesc.currentItem
        rptNoteFr.WindowState = 2
        rptNoteFr.PrintReport (False)
        deEstimations.conEstimations.Close
        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?
0
Comment
Question by:dcprog
[X]
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
4 Comments
 
LVL 14

Accepted Solution

by:
Shiju Sasidharan earned 750 total points
ID: 12414317
Hi
Try by removing the statement
>>Set deEstimations = Nothing
;-)
Shiju
0
 
LVL 8

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.
0
 

Author Comment

by:dcprog
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.
0
 

Author Comment

by:dcprog
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.

Thanks.
0

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