Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Clear Multibox

I've been trying to Clear values from a Multi Box with a Macro. I can't use the Clear All function as I only want to clear some values contained in the Multibox.

I tried the following code but it only works on List boxes.

public function clearCycle()

set mb = ActiveDocument.GetSheetObject("MB07")

mb.Clear

end function

Is there anyway to achieve this?

1 Solution

Accepted Solutions
IAMDV
Not applicable

Re: Clear Multibox

Hi Luis Cazares lcazares,

You can't use the Clear Method to clear the selections in ListBox. This is because you can only use this method to clear the ListBox and Field. However, MultiBox is a logical object and works at the presentation layer. So you need to use the ClearMemberFields Method. Here is the code...

Sub Clear_MultiBox_Fields()

     ActiveDocument.GetSheetObject("MB01").ClearMemberFields

End Sub

In the above code ClearMemberFields checks the Fields which are used in the MultiBox ("MB01") and then it clears the selections only for this MultiBox.

I hope this helps!

Cheers - DV

3 Replies
IAMDV
Not applicable

Re: Clear Multibox

Hi Luis Cazares lcazares,

You can't use the Clear Method to clear the selections in ListBox. This is because you can only use this method to clear the ListBox and Field. However, MultiBox is a logical object and works at the presentation layer. So you need to use the ClearMemberFields Method. Here is the code...

Sub Clear_MultiBox_Fields()

     ActiveDocument.GetSheetObject("MB01").ClearMemberFields

End Sub

In the above code ClearMemberFields checks the Fields which are used in the MultiBox ("MB01") and then it clears the selections only for this MultiBox.

I hope this helps!

Cheers - DV

SunilChauhan
Not applicable

Re: Clear Multibox

use below code in control+M

sub clearCycle()

set mb = ActiveDocument.GetSheetObject("MB07")

mb.ClearMemberFields


end sub

see the attached file

select one item in multibox and then click on button

hope this help

Not applicable

Clear Multibox

Thanks to both of you, it worked perfectly.