Pretty sure you will need to set the object name for these tabs to be able address them in this manner.
This should help if you aren't aware out to do that.
You probably do need to set to the text field with the calculation you have specified above. Calculations aren't stored, and it makes a difference to another calculation how "Accessible" that information is. If it's calculated, and then the calculation has to do another calculation, I have noticed this can give, unpredictable results.
Change it to a text field with a calculation. I'm betting that clears it up.
I'd use set field to set the field to this Case Function with OnObjectModify the script trigger set on the tab control.
In FileMaker 12 and newer, there's a script trigger OnPanelSwitch and some get functions: Get ( TriggerCurrentPanel ) and Get ( TriggerTargertPanel ) that can make the code for this much simpler.
Thanks for the help. I changed it to a text field w/ a calculated value, but it needed the Set Field script to actually make it work.
Once again - and definitely not for the last time - thanks Phil!