I would like to write a macro that will run every time a record is entered into a certain table. What I want the macro to do is check to see if there is a related record in a different table, and if so, to change a field of data type Yes/No to Yes. If no related record is defined yet, I would do nothing, as the default for the Yes/No field is No.
The two tables are related in this way.
So when a record is entered in to the tblOrders table, I need to check if a related record exists in the tblRecipes table, and I would like to use a macro to do so if possible, as I will be repeating this action for every Order entered.
Is this possible, and if so, what would the macro language be please?
The usual thing would be to use forms for data entry and to check the Recipes table in the before update event for the control, for example.
However, in Access 2010, you can use data macros. This example will run whenever CustomerPartNumber is changed in Orders.