Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Clear input with a button

Hi guys,

I have a table with four editable fields and I would like to make them empty by pressing a button.

I have read and tried several examples on the forum but they didn't worked.

Surely I'm doing something wrong but I do not know what.

Can anyone help me? thanks a lot

1 Solution

Accepted Solutions
rubenmarin

Hi Mattia,

You're refering to "Input fields"? in this case you can write a macro:

Sub ResetInputFields

    SET fld = ActiveDocument.Fields("YourInputFieldName")

    fld.ResetInputFieldValues 0

End Sub

The button just needs to call this macro with an External -->Run Macro action.

View solution in original post

13 Replies
reshmakala
Creator III
Creator III

Hi.. please find attached. Is this what you are looking for?

rubenmarin

Hi Mattia,

You're refering to "Input fields"? in this case you can write a macro:

Sub ResetInputFields

    SET fld = ActiveDocument.Fields("YourInputFieldName")

    fld.ResetInputFieldValues 0

End Sub

The button just needs to call this macro with an External -->Run Macro action.

Anonymous
Not applicable
Author

i get error...  the columns  where I enter my data to be deleted are called: premi nazionali S/N, premi listing S/N .

so I want to first try with a column and I did:

Sub ResetInputFields

    SET fld = ActiveDocument.Fields("premi nazionali S/N")

    fld.ResetInputFieldValues 0

End Sub

but dont work

Anonymous
Not applicable
Author

No, i have a table with fields where you can write

Anonymous
Not applicable
Author

Hi Mattia,

that macro resets an inputfield and restores original values, it can't make it empty.

However, in ActiveDocument.Fields instruction you have to insert input filed's name, not column's name (that i think it's an expression, such as InputSum or InputAvg).


Elena

Anonymous
Not applicable
Author

the names are the same because my column takes its name from the script where i have my inputfield

jzimolong
Creator II
Creator II

Not sure, but the following thread has a sample at the very end that might help:

http://community.qlik.com/thread/32005


engishfaque
Specialist III
Specialist III

Dear Mattia,

Kindly find attached QVW document,

Kind regards,

Ishfaque Ahmed

krishna20
Specialist II
Specialist II

Hi,

follow this link,it may helps.

http://community.qlik.com/message/185926#185926

Regards

Krishna