There is no action to detect access closing, so you must have a small HIDDEN form.
this form would open in autoexec macro with the main form.
this form has the shutdown command. When access closes, the form closes, then runs the logoff.
here is the hidden form code.
Code:
sub form_unload()
LogOffPC
end sub
this code goes in a module
Code:
Declare Function ExitWindowsEx& Lib "user32" (ByVal uFlags&, ByVal wReserved&)
'//constants needed to exit Windows
Global Const EWX_LOGOFF = 0
Global Const EWX_SHUTDOWN = 1
Global Const EWX_REBOOT = 2
Global Const EWX_FORCE = 4
'//log-off
Sub LogOffPC()
call ExitWindowsEx(EWX_LOGOFF, 0&)
End Sub