Results 1 to 5 of 5

Thread: [RESOLVED] AccessReport RangeFromTo Similar to Data Report

  1. #1

    Thread Starter
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    Resolved [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:
    1. On Error GoTo errReport    
    2. rptCustomers.PrintReport True, rptRangeFromTo, pagefirst,pagelast
    3.  Unload rptCustomers

    Another one is the code to print access report using VB

    VB Code:
    1. Dim appaccess As New Access.Application
    2.     appaccess.OpenCurrentDatabase App.Path & "\mydbase.mdb"
    3.     appaccess.Visible = False
    4.     appaccess.DoCmd.OpenReport "rptEmployee", acViewNormal
    5.     appaccess.Quit
    6.     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:
    1. pagefirst = Val(InputBox("Input beginning page to be printed"))
    2. pagelast = Val(InputBox("Input last page to be printed"))
    3. appaccess.DoCmd.OpenReport "rptEmployee", acViewNormal

    Thanks....
    Last edited by KGComputers; Mar 10th, 2006 at 01:38 AM.
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  3. #3

    Thread Starter
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    Re: AccessReport RangeFromTo Similar to Data Report

    Which should be the first code the docmd.printout or the docmd.openreport?
    Thanks
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  5. #5

    Thread Starter
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    Re: AccessReport RangeFromTo Similar to Data Report

    Hi RD,

    Thanks for the idea...

    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width