Rename a trigger (ADP)
Note The information in this topic applies only to a Microsoft Access project (.adp).
When you change the name of a trigger, the trigger name is updated in your database as soon as you save the trigger. However, you'll need to update any references to the previous name in other areas where you've referenced it, such as in code.
- Open the trigger.
You can open a trigger to view or edit the text of an existing trigger that is stored in your database. Triggers are scripted in Transact-SQL for Microsoft SQL Server databases.
- In the Database window, click Tables under Objects.
- Right-click the name of the table whose trigger you want to open and choose Triggers from the shortcut menu.
- In the Triggers for Table: <table name> dialog box, select the trigger you want to open from the Trigger Name list, and then click Edit.
The trigger is opened in the SQL source code editor which you can use to edit the SQL statements. For more information about triggers and the CREATE TRIGGER SQL statement, see the Microsoft SQL Server documentation.
- In the SQL source code editor, replace the existing trigger name with the new name. (The trigger name appears after the
Create Trigger
statement.) - Click Save to save the new trigger.
- Delete the old trigger (unless you want two identical triggers with different names).
When you want to disable the actions defined in the trigger that are automatically carried out on your database immediately following the specified transactions, you can delete a trigger.
You might also want to delete any triggers that enforce referential integrity between related tables if you use database diagrams to design your database. Database diagrams use relationships instead of triggers for this purpose. Thus, if a trigger duplicates a relationship in a database diagram, you should delete either the trigger or the relationship.
- In the Database window, click Tables under Objects.
- Right-click the table whose trigger you want to delete and choose Triggers from the shortcut menu.
- In the Triggers for Table: <table name> dialog box, select the trigger you want to delete from the Trigger Name list, and then click Delete.
- A message prompts you to confirm the deletion. Choose Yes.
The new trigger name is now in the database.