In order to facilitate automation in MS Access Macro are alternative over VBA . This article specificly focus on Table or Data Macro.Table macro works in a similar way as Triggers does in MS SQL Server.This feature could be exploited in numerous ways to do accomplish various task.To implement this concept first of all we need to create a Database containing a table named tblStudent.Table will contain four different fields as shown in figure.
Now if we want to associate a particular Macro with this table depending on requirement we can do so using option Data macro in Design View.For the purpose of example we are considering After Insert event .
As shown in above figure,we have associated a macro named DataMacro1 with After Insert Event of Table named tblStudent. In order to complete above step ,we first need to create a Macro named DataMacro1.This macro have been shown in figure fig 1.3,As shown below Macro contains code for updating fields in another table named tblStudetails.
After inserting records in table tblStudent values would be subsequently updated into another table as well. Similar operation could be performed for other scenerio as well like when some record going to be deleted,updated etc.
It is advised that the information provided in the article should not be used for any kind formal or production programming purposes as content of the article may not be complete or well tested. Access Guru will not be responsible for any kind of damage (monetary, time, personal or any other type) which may take place because of the usage of the content in the article.
Copyright © 2019 ERP Makers