Tuesday, April 21, 2015

How to Run VBA Macro Code with a Microsoft Access Macro

Running VBA Macro Code with a Microsoft Access Macro Functionality

Suppose we have a Macro Code , developed in MS-Access to fulfill some task as follows :

Sub Exp_Query_Data2Excel()
'Code Stuff here
End Sub

Now I want Run this Macro by assigning it to Quick Access Toolbar / Though Access Macro event.

But , In MS-Access , We cannot assign the VBA Macros to the Quick Access Tool bar.

So that we can only run the Macro through Access Macro event as follows ;

First  define a Function in the VBA Macro Module and Call the above Macro into that Function as follows :

Function Exp_Query_Data()
Call Exp_Query_Data2Excel
End Function


Next , create Access Macro and define a RunCode event  then we have to Pass the Function Name , in the RunCode event as shown below : 


Now ,we can Run the VBA Code Macro "Exp_Query_Data2Excel()" with Access Macro "Run_A_Macro".

--------------------------------------------------------------------------------------------------------
Thanks, TAMATAM ; Business Intelligence & Analytics Professional
--------------------------------------------------------------------------------------------------------

No comments:

Post a Comment

Hi User, Thank You for visiting My Blog. Please post your genuine Feedback or comments only related to this Blog Posts. Please do not post any Spam comments or Advertising kind of comments which will be Ignored.

Featured Post from this Blog

How to compare Current Snapshot Data with Previous Snapshot in Power BI

How to Dynamically compare two Snapshots Data in Power BI Scenario: Suppose, we have a sample Sales data, which is stored with Monthly Snaps...

Popular Posts from this Blog