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
1
vote
2 answers

Event Driven Data Macro to Calculate Field in New Record - MS Access

In MS Access 2013 I have a table called [Serials] which consists of only 3 columns: [ID], [Hashed ID] and [Product Description]. [ID] is an Incremental Integer Autonumber, and the Primary Key. [Hashed ID] holds the result of a Hash Function applied…
1
vote
1 answer

Why does a DLookup in a Before Change data macro sometimes return an old value?

I have a large relational Access 2010 database. It is normalized, and includes some union queries that are very slow. I therefore thought I could speed things up by creating some cached fields. For example in tblOrder I would create a…
1
vote
1 answer

XSD file to validate XML source code for Access data macros

Where can I find the XSD file I need to validate the XML that you get when you copy the code from an event-driven Data Macro (e.g., "After Insert", "After Update", "After Delete") in Access 2010 or later? I generally write the XML in Notepad++ and…
Taffy
  • 59
  • 6
1
vote
1 answer

Cannot edit or re-save an existing event-driven Data Macro in Access 2010

(This is a follow-up to an answer from an earlier question here.) I have an Access 2010 database file containing a table with a Before Change Data Macro: I can open the table in Datasheet View and add rows, and the Data Macro behaves as expected.…
Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
1
vote
1 answer

MS Access event-driven Data Macro to update table (example)

I have imported some data into Access from Excel. Now I want to write a code similar to trigger which will update another table whenever I get new data from Excel. I know I cannot write a trigger in Access, so I am trying to use a Data Macro. Can…
SAM244776
  • 1,375
  • 6
  • 18
  • 26
0
votes
1 answer

MS Access Data Macro to SET a calculated field value on INSERT using DMAX

I have a two table scenario with a typical parent / child relational setup: tblGroup - idGroup (autonumber, PK); GroupName (Short Text), Rank (Number) tblRange - idRange (autonumber, PK), idGroup (FK -> tblGroup.idGroup), RangeName (Short Text),…
The Frog
  • 85
  • 7
0
votes
0 answers

Get values from text/combo boxes on form to different table

Dim strSQL As String Dim strSQL1 As String Dim strSQL2 As String Private Sub Command208_Click() strSQL = "INSERT INTO PKR([Claim Number],[WANDFNF],[WANDOUP],[WANDEA]) VALUES ([Forms]![Form Level].[Form]![Claim Number],[Forms]![Form…
0
votes
0 answers

How to import/copy Data Macro to a table

I am trying to figure out how to import Data Macros to my tables in Microsoft Access 2019/365. I have a lot of tables/columns that I want to add a data macro to for Audit Trail creation. If I copy a macro from the Macro Design screen in MS Access…
psycoperl
  • 121
  • 1
  • 15
0
votes
0 answers

Is there a way to convert my old data macros from table to vba after a database split?

I recently split my ms access database into a front, and back end. I didn't know that the data macros that were on the table wouldn't be able to work anymore. I was wondering if there is any way to convert these to vba. if IsNull([prmQuoteID]) …
0
votes
0 answers

"After Update" data macro runs VBA, but SQL SELECT in that VBA returns the pre-update row

I run a VBA function from an "After Update" data macro via SetLocalVar. This VBA function queries the row that was just updated (taking the table name and a unique ID to select). However, the row that I get is the pre-update row. So it is as if my…
jccc
  • 41
  • 2
0
votes
1 answer

Excel function in access db

How to use excel function in access db? We have a policy numbers I would like to know if the policy number repeats return 0 otherwise 1 In excel: =IF(A2=A1),1,0 How can I write this formula in access? Please appreciate your help. Thanks.
0
votes
1 answer

Datamacro can't be found after split dadatabase

I have an access 2007 database with datamacros in the tables. After splitting the database because I want multiple users to work in it they cant be found. How do I fix this?
0
votes
1 answer

Data Macros in MS Access not working with SQL-Queries from JAVA

I created a Database (MS Access) and a frontend with JavaFX. In one table, I implement a data macro, which trigger INSERT Events in a different column (CurrentUser()-Function). I tested the data macro in different ways (created a row directly in MS…
Andy
  • 26
  • 2
0
votes
0 answers

Create a Custom ID in Access

I would like to create a Custom ID in format, "SACYear-Sequential Number", in an Access 2013 Table (Table Name = poledata) when records are appended into that Table. eg. SAC18-1 (18 means 2018) I have researched and found the code as below. As…
Ra-chel
  • 9
  • 1
0
votes
1 answer

Access 2016 Table Macros After Insert modify fields in newly created record

Using a custom form, fields are updated on a newly created record by an operator. When a new record is created there are fields within that newly created record that are to be updated based on values in another field. For example a field, CustID is…
John Albrett
  • 9
  • 1
  • 2