Print MS Access report form visual basic

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • El_Embozador

    Print MS Access report form visual basic

    Hi , please can you tell how i can print an MS ACCESS Report form visual
    basic, i ned a sample code ..

    Thanks



  • Norman Yuan

    #2
    Re: Print MS Access report form visual basic

    This question has been ansered in variuos VB NG for many, many times over
    many years. If you do a Google search comp.lang.basic .* or
    miscrosoft.publ ic.vb.*, you could get scores of post regarding this topic.

    Anyways, here is the hint:

    1. Set reference to Access Object Library in your VB project. (that means,
    your app will need Access installed to run this functionality);

    2. Launch Access from your code by creating Access.Applicat ion object:

    Dim acApp As Access.Applicat ion
    Set acApp=New Access.Applicat ion

    then you need to open the *.mdb (or *.adp file if it is an Access Project):

    acApp.OpenCurre ntDatabase("... ...")
    acApp.OpenCurrn etProject(".... .")

    3. Use DoCmd object to open existing report in *.mdb file.

    acApp.DoCmd.Ope nReport "......."

    You need to investigate Access Object Model, particularly,
    Access.Applicat ion and DoCmd objects. Once you learn more on them, you could
    even dynamically modify existing reports before you open them for
    previewing/printing.


    "El_Embozad or" <bozza1@telcel. net.ve> wrote in message
    news:DLTkb.786$ J3.55579@news01 .t-net.net.ve...[color=blue]
    > Hi , please can you tell how i can print an MS ACCESS Report form visual
    > basic, i ned a sample code ..
    >
    > Thanks
    >
    >
    >[/color]


    Comment

    Working...