You'll need to name your tabs using the "Name" entry in the Inspector window in layout mode. Then, assuming you have a tab assigned an Inspector name of "Trade," you can evaluate its state using GetLayoutObjectAttribute ( "Trade"; "isFrontTabPanel" ).
There are ways to write a recursive custom function in Advanced that will dynamically find the name of the front tab panel (or all front tab panels, if you have nested tab panels or multiple tab panels on the layout), and FM12 has script triggers that could set a global variable every time the tab panel changes (for recordkeeping), but I usually consider those methods overkill. The formula above returns 1 or 0 when you pass it the tab name you're interested in - simple as that.
Edit: Just keep in mind that "isFrontTabPanel" reports on whether the named tab is the front tab only in the context of its own tab panel, regardless of whether that tab panel is contained within an inactive parent tab. If you nest tabs, you'll probably want to run multiple checks if you're trying to check a sub-tab.
Thank youvery much - works perfectly...
Also, there are new functions and a new script trigger in FileMaker 12. If you have that version these new features provide options for working with tabs that are often much less cumbersome than the chain of IF - Else - IF's testing each tab panel in turn to figure out which one is the front panel.