Link to home
Start Free TrialLog in
Avatar of rvfowler2
rvfowler2Flag for United States of America

asked on

Tab Panel Script Trigger Issue

Based on a prior EE answer, I revised a script in order to execute a calc when I entered the Tab "LeadCounter" from the "MainData" tab.  I gave each of these a name in the "Name field" in FM 11's Inspector and then attached it to the script, but it doesn't work.  What am I doing wrong?  See attached.

Also in the attached are screen prints showing I searched EE (why isn't my previous question about using script triggers with tab panels there?) and that I searched FM Help.  Thanks.
TabControlIssue.doc
ASKER CERTIFIED SOLUTION
Avatar of jvaldes
jvaldes
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rvfowler2

ASKER

Yes, I wasn't clear, mixing two issues.  First, I want to prevent the tab "bounce," meaning when you select a Tab trigger to OnObjectModify, when you leave the tab, it also sets off the trigger, and I don't want that.  See the attached.  I tried to take care of the "bounce," but this scripting did not work.  How would you do it?

Second, I want a calculation to be set off once I enter a tab, but you answered that question.  Turns out my test of that didn't work for another reason, but fixed that.  Thank you.
TabBounceTest.doc
To eliminate the bounce, use the script trigger to set a variable like $CurrentObject, not to execute a script. That way you can choose when you fire the script.

Tell me if this helps
But I want to do both:  I want to prevent the bounce, but I also want to set off a trigger.  Notice in the earlier Word doc that I had successfully done it for an Admin Only tab so non-Admins could not enter the area and were sent back to the MainData tab.  However, I can't seem to make it work here.
Fire the script from a different trigger, for example if you keep $CurrentObject, you can decide if the abject is the same as the prior Obect and not fire...
I just tested it and it confirmed my memory that the only script trigger that works with Tab Panels is OnObjectModify.  The other issue is that for some reason that scripts I've attached above don't take care of the bounce.  Not sure why.  I'm new at this.
Post an example of the problem and I will help you resolve it. I don't think I was clear, if the first step in your script that you trigger with OnObjectModify you check to see if $CurrentObject is different than the current object and only trigger if different it will not fire if you don't change the object in the same tab object.
Yes, I never did understand why the attached AdminOnly script worked.  I just tested it in another dbase and it works!  But, it does not work here.  Now I'm really confused, so let me write this out.  First
set $tab = GetActiveLayoutObjectName
If GetActiveLayoutObjectName = AdminOnly
then
go back to old tab (but how do you script this?)

Forget it, I'm completely confused.  I know this is easy, but I just can't get it.  I have to get back to work.  I just spend a half hour on this.
Adminonly.doc
Avatar of Member_2_908359
goto object ([tab name]) to swicth tabs.
have a look at my example I did a few weeks ago, it was taking care of the bounce problem as well. I have not got the file here, but I may locate it too-morrow on my other PC. Have you placed a trigger object on each tab?
I'm not sure what example you mean.  I've searched EE and didn't find it, even the one I asked about 3 months ago.  Not sure what you mean about a trigger object on "each" tab as once I place a tigger on one tab, it seems to show up on all tabs.
I remember I did it after an explanation of jvaldes, maybe I did it for me only, and did not send it? can't remember now.
well, the file is on my portable I think, not even sure, maybe on my PC @ home (won't be there before next saturday). I'll have a look tonight on my portable and see if I have it with me.
internet connection down at the hotel, could not connect to check the file. will try again tonight.
OK
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
First, tried your method and it didn't work for me.  I edited out the message box and maybe I affected it.  See attached.  Also, figured out why my prior code worked in one database and not another.  Whoever gave me the code also had me put code into the conditonal formatting for a text box (also shown in the attached) that was on the AdminOnly tab panel.  Very strange way of doing it, but it works.  However, I think I'd rather use yours if I can get it to work.
TabControlIssue.doc
you are confusing the tab label which does not matter and the tab object name which the one to use for switching tabs. you doc does not show the tabs object names.
and yes, you need this conditionnal format on all tabs to find out the current tab, and set the old one to go back to it whenever needed
Actually, I am aware of the difference between tab labels and the object names.  Notice that my labels have a space between them and the object names do not.  Looks like you confirmed that what I forgot was to add text and add the conditonal formatting script to it.  Thanks.  Awarding points.