Hi Steve,
Firstly, global variables are a serious no-no. remember the web server application is being shared by many users at the same time, so the global variables are being shared by them all as well.
If your global variable is THREADed then it'll basically be blank all the time because everything happens on it's own thread. (even various routines in the same procedure, which also makes locals somewhat useless). If the globals are not THREADed then you will quickly encounter contention issues which will result in weird behavior.
So what you need to use are Session variables. Set them wherever you want to, and use them wherever you want to. They "belong" to one user. So you can treat them as "globals" but they belong to just one user.
For a filter, the classic construction looks like this
'TRI8:CustomerCode=' & p_web.GetSessionValue('GLO:CustCode')
IF Customercode is a numeric. IF it's a string then it looks like this
'TRI8:CustomerCode= <39>' & p_web.GetSessionValue('GLO:CustCode') &'<39>'
(all on one line)
Presumably elsewhere in your app (maybe on a web form, or in hand-code) Glo:CustCode has been set to something.
Cheers
Bruce