Again, you've described "how" you want to do something (run code when the
last user exits). Why? What does that code do? I ask because there may be
other ways to meet the underlying need.
If you want a table to track users (aside from using the .ldb file, which
tracks users), you could create one. It might even be enough to have a
single numeric field, defaulted to zero. When each person logs on, the
count is incremented. When each person logs off, the count is decremented,
and, if zero, your code runs.
But what would you do to handle the situation when someone's copy of Access
crashes and they bail without using your "exit" routine?!
Regards
Jeff Boyce
Microsoft Office/Access MVP