Setting global from selected table record

I have a Tab application that shows several grid applications for a specific department. Each grid application will therefore use the global [glo_department]. I have a table with all departments.

How to select in a grid_department application within the Tab the department and then setting the global [glo_department]?

Does this link help you? http://www.scriptcase.net/forum/forum/applications/grid-reports/6055-define-a-variable-in-session?5874-define-a-variable-in-session=&p=30295