Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab Controls - How do I tell which tab has been chosen by the user? 2

Status
Not open for further replies.

emaduddeen

Programmer
Mar 22, 2007
184
US
Hi everyone,

Can you tell me what code to use to determine which tab has been chosen by a user?

The 2 tab use variables I am using are: ?Tab:Categories and ?Tab:Inventory

Thanks.
Emad
 
You need to query the sheet use-variable, i.e. ?CurrentTab
CHOICE(?CurrentTab) returns the tab-number, 1=most left tab, 2=2nd tab, etc.

Code:
execute CHOICE(?CurrentTab)
    message('Categories selected')
    message('Inventory selected')
end

If you want to run code when the user selects a new tab, you can add an embed at the sheet (?CurrentTab) NewSelection event. Then use CHOICE(?CurrentTab) to determine the action.
Good luck!
 
Hi Emad,

You can also use :

CASE ?CurrentTab{prop:ChoiceFeq}
OF ?Tab:1
OF ?Tab:2
...
END

Regards

 
Hi ShankarJ,

Thanks for the code.

It looks easier for me to read.

Truly,
Emad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top