Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Urgent !!!

Hi,

Is it possible to read the value of list box in the front end to vba scritp editor.

for instance I have column name called Trans that contains 100,400,500 and I would like to use the Trans in the module script editor, is it possible.

Regards

Chriss

3 Replies
ramonarcusa36
Contributor III
Contributor III

You can try something like this:

Set myFld = Activedocument.Fields("Trans")

Set myValues = myFld.GetSelectedValues

If myValues.Count = 1 Then

   Msgbox myValues.Item(I).Number

Else

   Msgbox "There are " & myValues.Count & " selected values"

Next

You can also iterate through selected values with something like this:

For I = 0 To myValues.Count - 1

       N = myValues.Item(I).Number

       ...

Next

Don't forget Msgbox only will work with IEPlugin, never with Ajax...

And be careful with the Number property: sometimes you have to use Text property.

Hope this helps!

Anonymous
Not applicable
Author

 

Hi Chriss

this below code will give you the selected values in the listbox(fieldname)

field_name is the field name that is used in the listbox

SET lbs = ActiveDocument.Fields("Field_name")
SET lbsV = lbs.GetSelectedValues

lbsV(is an array wich will store all the selected values in the listbox(field)

regards

Harsha

Not applicable
Author

Hi,

Thanks for your support.

Currently I am testing the script as what you advised, let me update you tomorrow.

Regards

Chriss