I am unable to set default or null value in MS access. For example, when I tried to delete parent row, the foreign key of the affected child row is not set to NULL. I have tried setting default value to NULL at the design view but it does not seem to work.
Here is my sample data:
In staff table:
ID | Name
1 | Tom
2 | Tim
In customer table:
ID | Name | processed_By
1 | cust1 | 2
If I were to delete Tim from staff table, cust1 still retains 2 in processed_By column. However I wanted it to perform the following after deleting Tim from staff_table.
ID | Name | processed_By
1 | cust1 | NULL
OR
ID | Name | processed_By
1 | cust1 | 1
Hope that you can help me to solve this question. Thank you.
You can do this easily enough in MS Access 2010 with the new data macros
Data macros even work when the table is used outside of MS Access. Note the keyword
Old, applied to the Staff table where the After Delete macro is created. The line/* deleteis a comment and purely for illustration.