Raymond,
There are a couple of ways to handle this. The assumption I am going under is you want this situation to occur the first time the user starts the application, and if they start the application ten times in one day the sequence of events will happen exactly ten times.
This method assumes you have implemented Access Security. Every group name is a department name, and every member of a department is assigned to the group with his/her department name.
In a global module you associate a bit flag with each form.
Almost always, my startup routine opens a small unbound form hidden. It is the open event of that form which controls all of my housekeeping and setup routines. From this form you would set all form bit flags to false, get the users group name, and whatever else you might need to do.
The last thing this event does is open the menu which the user is going to see. In the open event of this and every form, you check the status of its associated bit flag. If the flag is false, you stuff the group name (department) into the forms caption, and you turn the bit on, so the next time the form is opened, the caption will be its original value.
You can use that hidden forms unload event to do all kinds of close down routines, the least of which is to be sure you really want the user to end his session or not.
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com