You will need a third table (consider using it in a separate file for ease of maintenance and security) for the logging of the fields you indicated; if this can be run from multiple locations/systems, you might also want to log some kind of "where" information along with the "when" & "who".
There are many different ways you can 'trigger' a script to run automatically; see the Filemaker Help with the phrase "script triggers".
As you think about where in the process of "scan an ID", "lookup value", "display value" that you want to trigger a "log this action" script, you also might want to consider other information for the log, such as 'status' of things such as failed scans (if you get that info), failed lookups (i.e.: invalid ID's), empty returned password field, etc. Recording that type of information in the "log table" will help you more quickly identify problems (deliberate or unintentional).