Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
montubhardwaj
Specialist
Specialist

Reseting Input box to Default Value

Hi All,

I have created an Input box using these two variables: Sales (Min) and Sales (Max). It is working fine as expected. But when we clear out
the selections or Variable values, in the Input Box, still the previously entered values is shown( though it is not actually selected). How can I reset
back to say “Enter Values”.  Below is the macro I am using. Thanks for your suggestions and time.

Sub input_box

A= Activedocument.variables("Sales (Min)").GetContent.string

B= Activedocument.variables("Sales (Max)").GetContent.string

Activedocument.Fields("Total_Sales").Select">" &A & "<"&B

End Sub

5 Replies
montubhardwaj
Specialist
Specialist
Author

I mean when someone clears the selections, the Input box should also set to Default Values like "Enter Sales" etc. Now, even after clearing, it retains its previously entered value.

sivarajs
Specialist II
Specialist II

check the sample it might helps you

montubhardwaj
Specialist
Specialist
Author

Hi Sivaraj. Thanks for looking into this. I actually want to clear the variables which are used the input boxes. So as soon as someone clears the overall selections, these variables should also re-set to default vales say "Enter vales" etc.I do not want to provide extra button for clearing these variables.

sivarajs
Specialist II
Specialist II

try using this

Sub input_box

A= Activedocument.variables("Sales (Min)").GetContent.string

B= Activedocument.variables("Sales (Max)").GetContent.string

Activedocument.Fields("Total_Sales").Select">" &A & "<"&B

A.Clear

B.Clear

End Sub

am not sure this will work but to avoid button you need to add something in macro

montubhardwaj
Specialist
Specialist
Author

This code will clear variables values everytime but I want it to be cleared only when Clear all is pressed.