Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Clear selection when changing sheets

Hi,
I want to clear a Selector when the user moves from a certain sheet to another certain sheet. The problem is that it does not concern all changes between sheets. Example: when the user moves from sheet A to sheet B the field should not be cleaned but when the user moves from sheet B to sheet C the filed should be cleaned.

Does anyone have any ides?

5 Replies
Not applicable
Author

Have a look at the Triggers tab on the Sheet properties, in particular the 'OnLeaveSheet' even.

Regards,

Gordon

jonathandienst
Partner - Champion III
Partner - Champion III

You can add a selection action to the OnActivate sheet and/or OnLeave sheet events. You can use these triggers to clear fields or set default selections. The only issue is that this needs to be done for each sheet.

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

If I use the OnActivate sheet I need to know which the previos sheet was, how do I get that information?

kji
Employee
Employee

You could define a variable LastSheet that you set in OnDeactivate Sheet, and check it in OnActivate.

Not applicable
Author

I tried this in OnDeactivate Sheet:





sub e

xitSheet
set LastSheet = ActiveDocument.ActiveSheet.GetProperties.Name
end sub

but it does not turn out well. When I change sheets, it stops in the macro with this message:
Object required: '[string: "Agent"]'