Results 1 to 5 of 5

Thread: [resolve]Newbie problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    3

    [resolve]Newbie problem

    Hi

    First I m more that a newbie un .net I only learn from 1 book and some tutorials
    but now
    I need to print from ms access (Repport1)every week day at 5 am
    for the time programming I will use MS Scheduler

    so it has to start (that where i need your help)
    a soft that open Access and print a specific repport then it close access and it self

    So i'l take every help i can get

    Thx
    Last edited by GGama; Dec 6th, 2005 at 01:29 PM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Newbie problem

    I suggest that you search MSDN for "automation access" (without quotes). Microsoft use the term "Office Automation" for remote controlling an instance of an Office application. MSDN will give you the basics on how to create an instance, interact with it and then close it. It's then up to you to use the Access VB reference to work out exactly what objects and members you need to use to achieve your specific aim.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    3

    Re: Newbie problem

    ok Automate Access is what I need
    thx
    Now i can open the Database but i have problem
    with the repport thing

    Dim Rapport As String
    Repport = "DetailRepport"
    System.Runtime.InteropServices.Marshal.BindToMoniker("c:\\scaledata.mdb")
    DoCmd.OpenReport(Repport, acViewPreview)

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Newbie problem

    What is the problem or error?

  5. #5

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    3

    Re: Newbie problem

    i went with this methode instead
    Private Sub FormMenu_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim oAccess As Access.Application
    Dim Rapport As String
    Rapport = "E_Inventaire détaillé"
    ' Start a new instance of Access for Automation:
    oAccess = New Access.ApplicationClass

    ' Open a database in exclusive mode:
    oAccess.OpenCurrentDatabase(filepath:="c:\scaledata.mdb", Exclusive:=True)

    'Print le Rapport
    oAccess.DoCmd.OpenReport(Rapport, Access.AcView.acViewNormal)
    'Fermer La BD
    oAccess.CloseCurrentDatabase()
    Me.Close()

    but it leave access open at the end
    i just need to find out how to close access and it will be done
    kill C:\Program Files\Microsoft Office\Office10 wont work
    DONE !!
    added
    oAccess.Quit(Access.AcQuitOption.acQuitSaveNone)
    Thx
    Last edited by GGama; Dec 6th, 2005 at 01:29 PM.

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