Renaming and Deleting Named Data Macros
When you need to rename or delete named data macros, or even delete data macros attached to table events, Access provides a useful tool to assist you. Open the tblErrorLog table in Datasheet view, click the Table contextual tab, click the Named Macro button in the Named Macros group, and then click Rename/Delete Macro from the drop-down list.
Access opens the Data Macro Manager. The Data Macro Manager displays a list of all the tables in your database that have data macros attached to table events, as well as all named data macros. You can expand the size of the Data Macro Manager by clicking the corner of the dialog box and dragging the window to a larger size. Beneath each table name, Access lists each table event or named data macro on a separate line in the Data Macro Manager. For table events, Access lists the name of the event, the words Event Data Macro, and a Delete link. For named data macros, Access lists the name of the named data macro, the words Named Data Macro, a Rename link, and a Delete link.
If you want to rename a named data macro, click the Rename link next to the named data macro that you want to rename. Access unlocks the name of the named data macro so you can change it. Access immediately saves the new name when you click away from the name box or click the Close button.
We don't need the named data macro we created in the previous section because it duplicates logic functionality we already have in the ClearErrorTable named data macro. To delete the test named data macro that you created previously, click the Delete link next to the ClearLogsTest named data macro. Access displays a confirmation message. If you are deleting a named data macro attached to a table that you currently have open, you also need to save the changes to the table after you close the Data Macro Manager. Click Yes to delete the ClearLogsTest named data macro.
In this tutorial:
- Creating Table Data Macros
- Uses of Data Macros
- The Data Macro Design Facility
- Access New Logic Designer
- Working with Before Events
- Grouping Macros
- Using If Blocks to Create Conditional Expressions
- Raising Errors in Data Macros to Cancel Events
- Testing Your Data Macro
- Defining Multiple Actions
- Collapsing and Expanding Actions
- Moving Actions
- Preventing Duplicate Records Across Multiple Fields
- Before Delete
- Working with After Events
- After Update
- After Delete
- Working with Named Data Macros
- Saving Named Data Macros
- Calling Named Data Macros
- Renaming and Deleting Named Data Macros
- Analyzing Errors in the USysApplicationLog Table
- Using Parameters
- Using Local Variables
- Working with Return Variables
- Debugging Data Macros
- Understanding Recursion in Data Macros
- Sharing Data Macro Logic