Results 1 to 4 of 4
  1. #1
    Join Date
    May 2009

    Question Unanswered: Trouble displaying Access query results from Excel macro

    I have an Access macro that runs a query. This macro functions fine in Access. I would like to run it in an Excel macro (I've very little vba knowledge and clipped what I could online). The macro I have in Excel runs my Access macro/query- it requests my parameters, but then no results are displayed. I don't know if I need to add something to my Access macro or to the Excel macro to fix this. Here is what I have on the Excel macro:

    Sub TrackingMultiple()
    Dim A As Object
    Application.DisplayAlerts = False
    Set A = CreateObject("Access.Application")
    A.Visible = False
    A.OpenCurrentDatabase ("P:\equityShared\rw\sales\Structured Equity Solutions\Institutional Coverage\Business Planning\Tracking.mdb")
    A.DoCmd****nMacro "SearchMultipleFields"
    Application.DisplayAlerts = True
    End Sub

    Any help would be much appreciated!

  2. #2
    Join Date
    Nov 2007
    Adelaide, South Australia
    Since you're designing an Excel macro, you would need Excel gurus. We're Access guru's.

    BTW Access gurus are waaaaaayyyy coooler than Excel gurus

    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!

    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Dec 2004
    Madison, WI
    Note: you can also utilize the "Shell" command in leu of your code.

    The shell command would be something you could use in a macro in excel.

    I believe in the parameters (using shell) you can then specify the MSAccess mdb to run a specific macro when opening (this is de ja vu...I think there's a post on this somewhere.)

    I started out developing in Excel and using Macros. I once even converted a full-fledged Excel program all designed around excel macros to MSAccess (because it was EXTREMELY slow opening the Excel program with all the records and macros.) It was an impresive Excel application with a few thousand lines of code (other than it being horribly slow and lack of a nice neat interface.)
    Last edited by pkstormy; 05-27-09 at 21:58.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  4. #4
    Join Date
    May 2009
    Thanks for your help.

    So my macro runs in excel, it's just the results don't pop up. I don't need the MSAccess mdb to run a specific macro when opening... My excel macro has a userform and when one clicks the button the access macro runs. All I need to do is figure out is why the access table doesn't come up in excel at the end of the macro like it does in access.

    Anyways, further help would be fine, and I'll also try looking for help from the not-as-cool excel gurus

Posting Permissions

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