+ Reply to Thread
Results 1 to 4 of 4

Setting "Current" access database and running macro from Excel

  1. #1
    Registered User
    Join Date
    10-20-2011
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    98

    Setting "Current" access database and running macro from Excel

    I found some code that will open a database with a file name and run an access macro.

    Example:
    Please Login or Register  to view this content.
    However i would like to skip the opening of a database and simply refer to the database that is currently open on my screen.

    Is this possible?

    Thanks
    Last edited by beat; 12-10-2013 at 04:09 AM. Reason: Shoddy Grammar

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Use GetObject instead of CreateObject.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    10-20-2011
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    98

    Re: Setting "Current" access database and running macro from Excel

    Wow thats great I'm almost there.

    I am not so familiar with access syntax.

    I want to pass a variable from excel to an access number filter. Mainform >>> Filter Column[TeamID] = myexcelvariable

    Any Examples you can give for this?

    Beat

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Setting "Current" access database and running macro from Excel

    If you are automating Access from Excel you should be able to do the filter on the form using the variable in the code.

    Off the top of my head you would do that by setting the Filter property of the form to "[TeamID]=" & yourvariable.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Excel 2010 -- "Visual Basic" "Macros" and "Record Macro" all disabled.
    By NicholasL in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2017, 06:11 AM
  2. [SOLVED] Excel Crashes or Gives "Automation Error" on Mac when running Macro
    By mlj61289 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-06-2013, 04:39 PM
  3. Importing data from Access database to Excel. Dont want headers/"field names".
    By Treenigheden in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-02-2012, 08:35 AM
  4. Replies: 6
    Last Post: 08-09-2006, 08:19 AM
  5. Using Access database to "populate" Excel Sheets
    By maacmaac in forum Excel General
    Replies: 1
    Last Post: 09-19-2005, 01:05 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1