|
-
Mar 10th, 2006, 12:41 AM
#1
[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....
Last edited by KGComputers; Mar 10th, 2006 at 01:38 AM.
-
Mar 10th, 2006, 01:48 AM
#2
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 10th, 2006, 02:01 AM
#3
Re: AccessReport RangeFromTo Similar to Data Report
Which should be the first code the docmd.printout or the docmd.openreport?
Thanks
-
Mar 10th, 2006, 02:27 AM
#4
Re: AccessReport RangeFromTo Similar to Data Report
Openreport should be first but open it in preview mode so it doesnt automatically print.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 23rd, 2006, 10:59 PM
#5
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|