Results 1 to 7 of 7

Thread: Passing a Variable to Access <Resolved>

Threaded View

  1. #1

    Thread Starter
    Member rabaile's Avatar
    Join Date
    May 2005
    Location
    Fayetteville, Arkansas
    Posts
    56

    Thumbs up Passing a Variable to Access <Resolved>

    I'm attemping to run an Access report through VB. The code works just fine, but for this particular report, the query it pulls from to generate the report requires the user to enter a parameter. It pops open a message box and asks for "Employee ID", which is used as a filter. How do I modify my existing code to pass the employee ID entered in my VB program to Access without the user having deal with the message box?


    VB Code:
    1. Private Sub EmployeeHRWeek()
    2.         Dim A As Object
    3.         A = CreateObject("Access.Application")
    4.         A.Visible = False
    5.         A.OpenCurrentDatabase("f:\svrc\timeclock\Timekeeping.mdb", False, "password")
    6.         A.DoCmd.OpenReport("EmployeeHoursByWeek")
    7.         A.Quit()
    8.     End Sub

    Thanks.
    Last edited by rabaile; Oct 23rd, 2005 at 02:49 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