[RESOLVED] AccessReport RangeFromTo Similar to Data Report
Hi all,
I have this code in a project which will input the beginning page and the ending page..Im using the data report in VB6..
VB Code:
On Error GoTo errReport
rptCustomers.PrintReport True, rptRangeFromTo, pagefirst,pagelast
Unload rptCustomers
Another one is the code to print access report using VB
VB Code:
Dim appaccess As New Access.Application
appaccess.OpenCurrentDatabase App.Path & "\mydbase.mdb"
appaccess.Visible = False
appaccess.DoCmd.OpenReport "rptEmployee", acViewNormal
appaccess.Quit
Set appaccess = Nothing
How can I enhance the second code (print access reports using VB) by prompting the user to input pagefirst and pagelast similar to the code using data report? Is there a possiblity to send the pagefirst and pagelast values to the appaccess.DoCmd.OpenReport? Or is there an equivalent code for my idea?
VB Code:
pagefirst = Val(InputBox("Input beginning page to be printed"))
pagelast = Val(InputBox("Input last page to be printed"))
appaccess.DoCmd.OpenReport "rptEmployee", acViewNormal
Thanks.... :) :) :)
Re: AccessReport RangeFromTo Similar to Data Report
TRy opening the report as acPreview and acHidden. Then do the DoCmd.PrintOut specifing the pages to print.
Re: AccessReport RangeFromTo Similar to Data Report
Which should be the first code the docmd.printout or the docmd.openreport?
Thanks
Re: AccessReport RangeFromTo Similar to Data Report
Openreport should be first but open it in preview mode so it doesnt automatically print.
Re: AccessReport RangeFromTo Similar to Data Report
Hi RD,
Thanks for the idea...
:) :) :)