I am trying to have an field in a table that holds the date time and is updated every time the record is updated. I'd like it to be done automatically via a macro/trigger. Any help?
I am trying to have an field in a table that holds the date time and is updated every time the record is updated. I'd like it to be done automatically via a macro/trigger. Any help?
make a select query that selects the data you wish to manipulate.
press the button to turn it into an update query and put =date() in the field you're updating.
add an event on the textboxes on the form for after update.
create a macro to run your query.
I am doing direct manipulation on the table itself. Is it not possible to assign a macro after update? I have tried using the Table Tools - Table - After Update but 'Show All Actions' is greyed out and I don't have access to SetValue.
The General Rule of thumb is that users should NOT be accessing/maintaining the data tables directly. In doing so, you can bypass a lot of controls, like this one you are trying to set up. You cannot set up macros or VBA to run against edits directly to the table.
That is why all data interaction should be controlled through Forms, where you can do those sort of things.
In later versions you can use a data macro:
https://support.office.com/en-us/art...d-f296ef834200
I stand corrected! It looks like in newer versions of Access, you CAN have macros run off of Table events (it didn't use to be this way).
So, it looks like if you are using Access 2010 or newer, you may be able to do what you want!
(Thanks Paul!)
No problemo! I certainly agree with not letting users work directly in tables.
Yeah, it's just good practice!
That is the problem with some of the newer Access features. Some almost encourage "bad" (or at least not recommended) design (i.e. multi-value fields!).