Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Preserve and clear selection when switching between tabs

I've seven tabs in one of my application. Out of which two tabs are related to each other(salesforce information) and other 5 tabs are not(Geography information). The requirement is; if user switches within salesforce tabs(SF1,SF2), I want to preserve selections made in either of the salesforce tab. However, if user moves out of the salesforce tab to a geography tab I want to clear the selections made in Salesforce tabs. I am not sure if it is possible using actions and triggeers in QV. Just to do a test I wrote a following trigger  OnLeaveSheet of both SF1 and SF2.  vActiveSheet is a variable here that captures/stores the name of the active sheet. It doesn't work as intended. Any one has thoughts on how to do this?

clear field             =if(vActiveSheet = 'SF1' or vActivesheet = 'SF2', ' ' , 'SF_GID')

clear Field             =if(vActivesheet = 'SF1' or vActivesheet = 'SF2',' ' , 'SF_Name')

1 Solution

Accepted Solutions
Not applicable
Author

Okay This is what I did to achieve what I wanted. I created a variable first which will capture/store the name of active sheet using a macro with the following code.

sub ActiveSheetSelect

set ss = ActiveDocument.ActiveSheet

set v = ActiveDocument.Variables("vActiveSheet")

v.SetContent ss.GetProperties.Name, true

end sub

I run the macro OnActivateSheet event. So every time I change tabs, 'vActiveSheet' variable will capture the name of active sheet. Then I created a variable event trigger for 'vActiveSheet' OnInput

=if(vActiveSheet = 'SF1' or vActiveSheet = 'SF2','','SF_GID')

and so on..

View solution in original post

1 Reply
Not applicable
Author

Okay This is what I did to achieve what I wanted. I created a variable first which will capture/store the name of active sheet using a macro with the following code.

sub ActiveSheetSelect

set ss = ActiveDocument.ActiveSheet

set v = ActiveDocument.Variables("vActiveSheet")

v.SetContent ss.GetProperties.Name, true

end sub

I run the macro OnActivateSheet event. So every time I change tabs, 'vActiveSheet' variable will capture the name of active sheet. Then I created a variable event trigger for 'vActiveSheet' OnInput

=if(vActiveSheet = 'SF1' or vActiveSheet = 'SF2','','SF_GID')

and so on..