Tabsheet in tabsheet

I’ve an issue with Tabsheets in Tabsheet.

I’ve a condition in my code which

} else if (repesstab.getSelectedTab().getCaption().equals("Access Control Reports") && repessacctab.getSelectedTab().getCaption().equals("User(s) Access Control Reports")){ do stuff here } The code never goes into that if condition. repesstab is my main tabsheet and repessacctab tabsheet is a component of repesstab.

Can someone let me know how to check whether a particular tab is selected inside a tabsheet?