Questions tagged [ms-access-data-macro]

Microsoft Access data macros enable you to add logic to events that occur in tables, such as adding, updating, or deleting data. They are similar to "triggers" in other SQL databases.

Microsoft Access data macros enable you to add logic to events that occur in tables, such as adding, updating, or deleting data. They are similar to "triggers" in other SQL databases.

Data macros are available in Access 2010 and later versions. For details, see the Microsoft Support article here.

44 questions
8
votes
5 answers

how to export Access 2010 data macros

I need to transfer Access data macros from my test db to my production db. Anybody know how to do that? I know that transferring tables from one accdb to another will also transfer the data macros, but that's not an option in my case. I also know I…
3
votes
2 answers

Can I use Access VBA to determine if a table has a Data Macro?

Is there a way to determine via VBA if an Access table contains a data macro or not? I have data macros on most of my tables, but my code fails if it encounters a table without it. I don't receive an error message. Instead, the code keeps running as…
EJ Mak
  • 799
  • 1
  • 8
  • 29
2
votes
2 answers

Call C# code from Access event-driven Data Macro?

Is it possible to call C# code in some way from an MS Access database file (not the Access application)? My scenario is when something will happen in some table I must call C# code (for example a web service). I read that MS Access doesn't support…
templaris
  • 221
  • 5
  • 11
2
votes
1 answer

Using MS Access triggers and/or querys to either insert or update a record

I have a 3rd-party software (Pro-face Pro-Server EX) that is inserting records into a MS Access database (.accdb file extension, not a front end for a SQL database). The way the process is configured on the Pro-Server EX software side is that it…
BT_SO
  • 25
  • 1
  • 3
2
votes
1 answer

MS Access run code after a row is updated

I am very new to MS Access, forgive me for this simple question but I am very confused with my current problem. So I want to run a VBA function after a table receives an update on one of its fields. What I have done is: Create a Macro named…
Nen
  • 165
  • 1
  • 2
  • 8
2
votes
1 answer

Data Macros: Using default values if LookupRecord does not find a match

I have been trying to set-up a Data Macro on one of the tables in Ms Access to add a 'path' and increment a level based on a parent record in the same table. Before Change, if the parent node doesn't exist then default values are used. Otherwise,…
Paul
  • 4,160
  • 3
  • 30
  • 56
1
vote
1 answer

MS Access, How can I detect new insert vs update inside trigger macros?

MS Office 265 ProPlus, Access 2007 - 2016 While defining a "Before Update" macro(?) on a table, I'd like to be able to detect when this is an update to an existing record vs inserting a new record. I know about and have used the "Old" context…
daveg
  • 1,051
  • 11
  • 24
1
vote
2 answers

Access data macro get value from query (auto numbering)

Instead of the using the auto number in Access (sometimes produces duplicates) I've decided to generate my own numbers. I am using the data macro Before Change but I'm not sure on how to run the query SELECT MAX(ID)+1 FROM MyTable and insert it into…
tutu
  • 673
  • 2
  • 13
  • 31
1
vote
1 answer

MS-ACCESS - Before insert/after insert/update trigger required

I have a PropertyOwnership table which has a PercentOwnership field. Please note that any property can have multiple owners, hence we require the percent ownership for each owner. When adding a record into the PropertyOwnership table, I would like…
1
vote
1 answer

MS Access AfterInsert macro update record

I have extremely limited knowledge of MS Access, but I'm trying to create an AfterInsert event. Here's the table (myTable) context-- The table is going to be a list of goals for different departments, and have an Active column. This will allow a…
jma
  • 457
  • 7
  • 18
1
vote
2 answers

How to update multiple records in same table using .AfterUpdate data macro without error "A data macro resource limit was hit."

I have a table tblItems with a list of inventory items. The table has many columns to describe these items, including columns for SupplierName, SupplierOrderNumber and PredictedArrivalDate. If I order several new items from a supplier, I will record…
1
vote
1 answer

Ms Access Data Macro Call VBA Function Out of Box

I am using a Data Macro for one of my Access table's After Insert event. Inside this Data Macro, I am using SetLocalVar to call one of my functions written in vba to insert the same inserted record set into my SQL Database. It works when I enter…
0014
  • 893
  • 4
  • 13
  • 40
1
vote
1 answer

Access 2010 Insert Trigger

I have a parent table (Assessment) with two children tables with 1 to 1 relationships defined. To make sure that a child row is never added that does not have a parent entry, I want to add an insert trigger to the child table (ConsequenceAssessment)…
tnt
  • 3,411
  • 5
  • 24
  • 23
1
vote
1 answer

How to run function in vba using data macro?

i am new to data macro in ms access 2013 and need some help with it. so lets assume that i have a simple database with only one table of Users. when i change the "Age" Field in the table, i want to run an external exe file (the reason why dosent…
oron
  • 13
  • 3
1
vote
1 answer

Run SQL query from an Access Data Macro

I'm trying to update a closure table using data macros, which requires running the following code whenever a new record is inserted into the main table: INSERT INTO tblClosure (parent_id, child_id, depth) SELECT p.parent_id, c.child_id,…
1
2 3