borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (how do u print certain fields?)Next Topic (Exporting from Datareport) New Topic New Poll Post Reply
AndreaVB Forum : Printing : printing/viewing an Access Report from VB
Poster Message
bpears
Level: Guest


icon printing/viewing an Access Report from VB

I have a VB app in which I am calling an Access report. In the code to run the report, I am passing the 'acViewPreview' command so as to view the report. However, this does not happen. Does anyone have any idea how to preview an  Access report in VB prior to printing it?

The biggest reason for this is that the user may want to go back and produce just one additional page from the report or produce a page that was missed due to a printer jam etc... Without the preview option, the user cannot do this. They would have to print the entire report again for just one page.

Any information would be very helpful!

Thanks,

Brad

02-12-2003 at 06:28 PM
| Quote Reply
BRMC
Level: VB Lord


Registered: 28-11-2003
Posts: 210
icon Re: printing/viewing an Access Report from VB

Hi bpears,
for me the best way is to put some references to Ms Access in your project and then u can manage all the thing in your db.
Also the report , if u ook in the object viewer there is all the object supported by this references.

Bye



____________________________
I don't mind not going to heaven
As long as they've got cigarettes
in hell

10-12-2003 at 12:20 PM
View Profile Send Email to User Show All Posts | Quote Reply
caloy
Level: Protégé

Registered: 15-03-2006
Posts: 4
icon Re: printing/viewing an Access Report from VB

try this small code.......

Dim objAccess As Object

dbName = App.Path & "\ <database name>"
rptName = "<report name"
Preview = acPreview 'acNormal

With objAccess
    .OpenCurrentDatabase filepath:=dbName
    If Preview = acPreview Then
       .Visible = True
       .DoCmd.OpenReport rptName, Preview
    Else
       .DoCmd.OpenReport rptName
    End If
End With


gud luck c==|{======>

15-03-2006 at 07:31 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Printing : printing/viewing an Access Report from VB
Previous Topic (how do u print certain fields?)Next Topic (Exporting from Datareport) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder