Marshall,
Just ran SaveAllDataMacros on the Source database
saving data macros for: tblAuditLog in file: C:\Users\jp\Documents\macrosFor_tblAuditLog.xml
tblAuditLog has no associated data macro(s)
saving data macros for: tblSource in file: C:\Users\jp\Documents\macrosFor_tblSource.xml
When I look at the Saved xml with Notepad++ I see the following
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<DataMacros xmlns="
http://schemas.microsoft.com/office/accessservices/2009/11/application">
<DataMacro Event="AfterUpdate">
<Statements>
<Action Name="RunDataMacro">
<Argument Name="MacroName">tblSource.macAuditTblSourceUpdateWorks</Argument>
</Action>
</Statements>
</DataMacro>
<DataMacro Name="macAuditTblSourceUpdateWorks">
<Statements>
<ConditionalBlock>
<If>
<Condition>Updated("Event 1 Complete")</Condition>
<Statements>
<CreateRecord>
<Data>
<Reference>tblAuditLog</Reference>
</Data>
<Statements>
<Action Name="SetField">
<Argument Name="Field">tblAuditLog.Orig_PK</Argument>
<Argument Name="Value">[tblSource].[PrimaryKey]</Argument>
</Action>
<Action Name="SetField">
<Argument Name="Field">tblAuditLog.REFERENCE</Argument>
<Argument Name="Value">[tblSource].[REFERENCE]</Argument>
</Action>
<Action Name="SetField">
<Argument Name="Field">tblAuditLog.EVENT</Argument>
<Argument Name="Value">"Event 1 Complete"</Argument>
</Action>
<Action Name="SetField">
<Argument Name="Field">tblAuditLog.NEW_VALUE</Argument>
<Argument Name="Value">[tblSource].[Event 1 Complete]</Argument>
</Action>
<Action Name="SetField">
<Argument Name="Field">tblAuditLog.USERNAME</Argument>
<Argument Name="Value">GetUserName()</Argument>
</Action>
<Action Name="SetField">
<Argument Name="Field">tblAuditLog.MOD_DATE</Argument>
<Argument Name="Value">Now()</Argument>
</Action>
</Statements>
</CreateRecord>
</Statements>
</If>
</ConditionalBlock>
</Statements>
</DataMacro>
<DataMacro Name="mactblsourceAuditUpdateFails">
<Statements>
<ConditionalBlock>
<If>
<Condition>Updated("Event 1 Complete")</Condition>
<Statements>
<CreateRecord>
<Data>
<Reference>tblAuditLog</Reference>
</Data>
<Statements>
<Action Name="SetField">
<Argument Name="Field">tblAuditLog.Orig_PK</Argument>
<Argument Name="Value">[tblSource].[PrimaryKey]</Argument>
</Action>
<Action Name="SetField">
<Argument Name="Field">tblAuditLog.REFERENCE</Argument>
<Argument Name="Value">[tblSource].[REFERENCE]</Argument>
</Action>
<Action Name="SetField">
<Argument Name="Field">tblAuditLog.EVENT</Argument>
<Argument Name="Value">"Event 1 Complete"</Argument>
</Action>
<Action Name="SetField">
<Argument Name="Field">tblAuditLog.OLD_VALUE</Argument>
<Argument Name="Value">[tblSource].[Old].[Event 1 Complete]</Argument>
</Action>
<Action Name="SetField">
<Argument Name="Field">tblAuditLog.NEW_VALUE</Argument>
<Argument Name="Value">[tblSource].[Event 1 Complete]</Argument>
</Action>
<Action Name="SetField">
<Argument Name="Field">tblAuditLog.USERNAME</Argument>
<Argument Name="Value">GetUserName()</Argument>
</Action>
<Action Name="SetField">
<Argument Name="Field">tblAuditLog.MOD_DATE</Argument>
<Argument Name="Value">Now()</Argument>
</Action>
</Statements>
</CreateRecord>
</Statements>
</If>
</ConditionalBlock>
</Statements>
</DataMacro>
</DataMacros>
Update: I then deleted the macros in the target manually. Then with the Target database I ran with the just saved data macros.
Module2.DataMacroFiles "C:\Users\jp\Documents\"
tabTest macrosFor_tabTest.xml
tblAuditLog macrosFor_tblAuditLog.xml
tblSource macrosFor_tblSource.xml
tCourse macrosFor_tCourse.xml
tCourseContent macrosFor_tCourseContent.xml
tStudent macrosFor_tStudent.xml
tStudentSession macrosFor_tStudentSession.xml
tStudentTestResults macrosFor_tStudentTestResults.xml
tSubject macrosFor_tSubject.xml
Table tblAuditLog has datamacro in Text file at C:\Users\JP\Documents\macrosFor_tblAuditLog.xml
---Macro was loaded from text
Table tblSource has datamacro in Text file at C:\Users\JP\Documents\macrosFor_tblSource.xml
---Macro was loaded from text
----------------------------------
And checked for data macros with query
SELECT Len([LvExtra]) AS Expr1, MSysObjects.Name, MSysObjects.Type
FROM MSysObjects
WHERE (((Len([LvExtra]))>32) AND ((MSysObjects.Type)=1));
Query1
Query1
Expr1 | Name | Type |
---|
2483 | tblAuditLog | 1 |
3142 | tblSource | 1 |