Settlement data based on multiple selection ListBox reference need help

Hello again,

The question that I have is selecting from a listbox with multiple selection to fill the tables with the selected data. My code is as follows:

Void loadData_EventClick (ByRef This)

Dim j

Dim k

k = 0

If ListBox.MultiSelection.Count = 0 Then Exit Sub

For j = 1 To ListBox.Items.Count

If ListBox.MultiSelection (j). Count = True Then

k = k + 1

End If

Next

TextBox.Text = k

End Sub

The code works perfectly up to the second if statement. My current channel group list contains 16 channels and with the second if statement guided the textbox output is equal to 16 (i.e. k = 16), which is what I expected. Im just using the k = k + 1 for the test. Eventually will be replaced by operating code specific to what I need to do.

So the question that I have is to get the code to recognize what values are selected and referring to the index for the selections in a table. Im not sure on how to do it.

Any help is very appreciated.

Thank you

~ Nathan

Attached JPEG shows the current user interface and the output of k with the second if statement commented

Hey Nathan--

ListBox.MultiSelection () is a function that returns an array of [multiple] selected items in ListBox.

ListBox.MultiSelection.Count is a property that returns the number of items in the table above.

Therefore, the logic in your second IF statement that says if ListBox.MultiSelection (j). Count = True really makes no sense because:

  1. The array returned by the multiple selection (using (j) indexing now refers to a single selected item in the list (which has not its own 'Count' property)

  2. If you don't the array index, assuming that you had selected 4 items in your list, your statement would still be actually as said if 4 = True which is not what you get.

Make sense?

Here is a modified version of your code that I hope makes it a little more obvious how these elements relate to one another.  Give it a run; of course, 75% of the code is extranneous to you working end to account, so make sure that you subsequently delete what you won't need.

Sub loadData_EventClick (ByRef This) ' creates the event handler
Dim j
If ListBox.MultiSelection.Count = 0 Then Exit Sub
TextBox.Text = "Total ListBox items:" & ListBox.Items.Count & + "" \n "".
TextBox.Text = TextBox.Text & "Total selected items:" & ListBox.MultiSelection.Count & + "" \n "".
TextBox.Text = TextBox.Text & "Selected Items:" & + "\n"
For j = 1 to ListBox.MultiSelection.Count
TextBox.Text is TextBox.Text & ListBox.MultiSelection (j). Text & ", index" & ListBox.MultiSelection (j). Index & + "\n"
Next
End Sub

You are making great progress; It will get quickly easily faster and we are here to help – do not hesitate.

Tags: NI Software

Similar Questions

  • control references; need help

    Im having a VI with control, let's say some Boolean control. Since another VI running, I want to be able to adjust the value of this control. How do I do that? I remember something about creating a reference the command and calling

    the reference to an another VI.  If I'm wrong, can someone clearly explain what they are for?

    Second, is there a way to call a Subvi and display the pabel before in a tab of the VI which I am the appellant?

    Thank you!

    1. in your control panel before the local VI go the modern-> Refnum-> Refnum of control and place it on your Panel. Then create what refnum control you need (in this case a Boolean value) and drag ' not drop it in the refnum of the front panel. Now, you will have a refnum your Boolean control in your block diagram. You can adjust the value of this control in an another VI (foreign) simply by placing a property node of your control (overseas VI) and the wiring of the reference already created for her. So basically, you pass the reference of the local VI abroad. The adjusted value can also be passed or, if it is static, it can be placed on the foreign VI.

    Sorry, I could not not to edit my previous post. Just thought I would elaborate on the first point a bit more.

    Please ask is that something is not clear enough.

    Jeff Bohrer says:

    On the block diagram, select the terminal you want to update right click > Create > Referance.

    Do not understand how I managed to forget this one, including the fact that I use this method in most cases

  • Error in reading data using the file adapter... need help.

    Hi all

    We try to read a flat file delimited using file adapter.
    The following data works.
    abc|"sssss"|jjjj
    hhhj|fgfdg|dsfsf
    sfdf|dsf|adfd
    But when a space is present after the closing for the second column, that the record quotation mark is rejected

    Format below does not
    abc|"sssss"   |jjjj
    hhhj|fgfdg|dsfsf
    sfdf|dsf|adfd
    any help how to read such data... help please.

    Kind regards

    Published by: Oraacler on April 27, 2010 21:30
     
    
    
      
        
          
            
              
                
                  
                  
                  
                  
                  
                  
                
              
            
          
        
      
    
    
    
    
  • How to extend my dates to use firefox systems ithink I've expired aug.23 2015 that do to extend the dates or can you do automatic I need help. t has

    I want to extend my subscription in firefox.it seems it expired on August 23, 2015 how can you help me I have 81 years old and cela my only diversion for a boring life. Please help me.

    What do you mean by membership of Firefox or systems?

    Firefox is a browser web and is 100% free to download and use to www.mozilla.org and it is not necessary to register for anything to use Firefox.

  • Using the value in the array to the variable of reference - need help

    Can someone tell me if this is possible in as3?

    I want to loop through an array and use the array value to refer to a variable.

    The installation program:
    (For illustration only. No real script)

    My MCs:
    triangle_mc
    square_mc

    Variables of placement:
    var triangle_mc_x = 160;
    var square_mc_x = 200;

    My table:
    [shape_array] (contains 'triangle_mc' and/or "square_mc")

    What I want to do:

    for each {(var: chaîne d'élément dans shape_array)}
    Item.x = Item + "_x";
    Item.y = 60;
    }

    It should do the same thing as:

    for each {(var: chaîne d'élément dans shape_array)}
    If (point == "triangle_mc") {}
    triangle_mc.x = triangle_mc_x;
    triangle_mc.y = 60;
    }
    If (point == 'square_mc') {}
    square_mc.x = square_mc_x;
    square_mc.y = 60;
    }
    }

    Thank you!

    I think what you are after...

    for each {(var: chaîne d'élément dans shape_array)}
    This [point] .x = this ["_x" + point];
    This point there = 60;
    }

    Although I have zero degrees of ease with this form of loop for... I was born and raised on the (I =?; I)

  • Box - does not not for multiple selection values

    Hello

    I have a box (with several static values) and a dynamic report that displays the filtered data based on the selection of the checkbox... my report refreshes correctly to a selection simple check box, but when I select several values, it gives me an error message...

    Here's the example query that I use:

    Select * from table_a
    where
    CATEGORY =: P22_CATEGORY

    Please advice...

    Hello

    I think that the type of box that you are referring returns a list delimited by two points values. If this is the case, you need a query something like:

    select * from table_a
    where ':'||:P22_CATEGORY||':' like '%:'||CATEGORY||':%'
    

    There is a description really here: http://apex.oracle.com/pls/otn/f?p=ATSIN_DEMO:COLON_DELIMITED

    Hope this helps,
    Gregory

  • Add the data in a field of multiple selection?

    Just got got off the phone with the support of Eloqua ask about the possibility of adding data in a field of multiple selection over time. Apparently, it's possible through mailings of form, but no list will be mailed.  Wouldn't be great if during a download list, you had the ability to add data from a field in your file .csv for existing values in this area in Eloqua.  Here's a use case for this scenario... in our society of industry can be part of multiple market segments.  Depending on the event, a person can feel they are part of the market segment 'Radar', but another event specializing in Sonar... they indicate that they are part of the market segment "Sonar", both being true.  There is currently no easy way to enter these data in Eloqua over time as part of the downloads from the list.  Based on the scenario above, the existing value is 'Radar', but if "Sonar" is the value of the field for the next download it replaces the value of 'Radar '.  Ideally, we would be able to capture the two values.

    I said that if there is enough interest in this idea, Eloqua would consider developing a new option for downloads from the list add vs crush.  I hope others can find a use case for this idea.

    Hi Tina,

    I know it's a bit old but I had a simular problem on adding values to a multi select.  Here's how I approached it.

    1. Add a text based contact field Eloqua to transfer your csv values.  Let's call it "MultiSelect download Value" for this example.

    2. Add Eloqua add values to a multiselect contact field.  What we'll call "MultiSelect Final.

    3. create a program that will add the download list.

    4. in the program, create a step to update Contact data

    . in the update rule, update "Definitive MultiSelect' field, Append the value in the field value, value will be hardcoded, check use a delimiter": ", marks the conditional rule the field" value to download MultiSelect "equals the value hard coded or one that you would like the field to be.

    b. create all update settings you need for your data.

    I approached this way because our downloads from the list should be add the data over time.  The field ' value to download MultiSelect ' allows it to be overwritten on each download.

    Let me know if you want more details.

    Thank you

    Blake

  • Is there a way to multiple selection data source in a Web App?

    I created two Web Apps. I'm trying to multiple selection of one of the lists.

    The idea is - I have a list of manufacturers and a list of distributors, a few hundred in each list. I would like to be able to set up a select field type 'data source' Web App Distributor and for that to be a function of multiple selection.

    Does anyone know how to do this?

    Web apps are only a 1 to 1 relationship, BC at this time doesn't support 1 to many, or many-to-many on web applications. If you can't sorry.

  • Delete in the database based on the values of the multiple selection list

    Hello

    I have a selectlist in Apex and a function in the database to make a deletion based on the value selected in the selection list.
    FUNCTION delete_batch (v_batch VARCHAR2) RETURN VARCHAR2
    IS
    BEGIN
    IF v_batch like 'M%'
    THEN
       RETURN ('A monthrun cannot be deleted');
    ELSE
       DELETE FROM so_disco_pa
       WHERE  batch = v_batch
       ;
       DELETE FROM so_batch_pa
       WHERE  batch = v_batch
       ;
       COMMIT;
       RETURN ('Batch '||v_batch||' has been deleted');
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
        RETURN ('Batch could not be deleted');
    END delete_batch;
    The package is called when the user clicks on the button Delete with the rest of the process:
    BEGIN
    DECLARE
    x   varchar2(100);
    BEGIN
    x := pa_control.delete_batch (:P3_BATCH);
    :F105_MESSAGE := x;
    END;
    END;
    Now, I want to change the selectlist for a multiple-selection list to make several batches can be deleted.

    How can I change my procedure and the procedure to remove lots based on the values selected?

    Thank you

    Diana

    dianap says:
    I got this far, but only the first batch selected in the list is being deleted. The other values of selected package are not removed.

    Help please.

    Move the RETURN statement out of your loop.

  • Automatic filling of multiple selection based on the selection list

    Hello

    I have a problem in filling multiple selection data in the selection list.
    I would like to take an example and explain.
    I have 3 tables: employee, Department and a link table for employee and department.
    The selection list contains employee and the Department is a multiple selection. Employee selection, all departments must be posted and belongs to the Ministry of which employee (which comes from the binding table) must be selected (high-lighted). How can I do this?

    HI 841762 :),.

    Do not use the 'style' to highlight that you would have found out by now that would make the blue text background while the font color remains black and this will make the text unreadable. Plus if there is a button on the page when you submit it to us, I doubt that it will store the State of the selected items in a multiple of P1_DEPT in session state. then try this...

    In the application process, replace, the status of 'style' that you used to highlight as you...

    ....
    If (rec.R=cnt)then
    htp.prn('');
    ELSE
      htp.prn('');
    end if;
    ...
    

    Then in the JS, use

    appendToSelect(list, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue,l_Opt_Xml.getAttribute('selected'));
    

    and change the function "appendToSelect".

    function appendToSelect(pSelect, pValue, pContent,pIsSelected) {
    
     var l_Opt = document.createElement("option");
     l_Opt.value = pValue;
    
    if(pIsSelected)
    l_Opt.setAttribute('selected','selected');
    
    if(document.all){
      pSelect.options.add(l_Opt);
      l_Opt.innerText = pContent;
     } else {
      l_Opt.appendChild(document.createTextNode(pContent));
      pSelect.appendChild(l_Opt);
     }
    }
    
  • How do I script a listbox for multiple selections may be recognized?

    I have a pdf that allows the user to make selections in a list box, and then these choices determine which fields on the page are displayed or hidden. I made sure listbox allows multiple selections, but I can't get the script to recognize and display several fields. So far it works when an item is selected. How can I do so when the user selects multiple entries that it will cause several fields actually show?

    I have included the file to show what I got so far.

    I answered this in your other post.

    Paul

  • Help with POST data if multiple selections are chosen

    I created a form with a menu (list) which includes all 50 States. I used the MESSAGE option, as well as PHP, to treat form data, which will be sent to me. The list menu looks like this: http://askdave.info/help/states_menu.gif and I have "Allow multiple selections" checked in the property inspector.

    If the user chooses several States, I want EACH of these States to be included in the email that I receive. Right now, if I check several States, I get only the latest state selected. For example, here is the email that I get after I check 5 different States. http://askdave.info/help/FormData.gif

    Problem-> in this email, only one State is indicated (Hawaii), even if I selected 5 different States. How can I get the data from the form to list all THE States that are checked?

    Here's what I have:

    < form name = "form1" method = "post" action = "process.php" >
    < input type = "hidden" name = "required" value = "name, phone, email, States, capital" / >

    And then for the menu that lists the States, I have:

    < label >
    < select name = 'States' size = '7' several id = 'States' >
    all States < option > < / option >
    Alabama < option > < / option >
    Alaska < option > < / option >
    Arizona < option > < / option >
    Arkansas < option > < / option >

    and so on...

    What Miss me? How can I get the PHP script to send multiple values, if multiple values are selected? (I'm new to PHP, so go easy on me.) I can post my code, if necessary.) Is this a PHP problem, or do I have to add something to the HTML form?

    Hello

    >>
    I think that DynaForm is synonymous with dynamic form
    >>

    This makes some sense ;-) I was wondering just because there is a pre-made script called DynaForm here, but it has a different 'Logistics' than yours.

    However, both "DynaForm" versions are pretty basic, because they deal only with non-multiple values - fields as a single line, texareas and select´s non-multiple of form input fields. Your script for example just loops through all the existing form fields using the method "foreach":

    Out of form fields and values.
    foreach ($this-> post as $field-online $value) {/ / loop through all form fields}
    If ($field == "required") continue;
    $this-> _addLine ($field, $value); Here´s where the field´s name/value consolidation happens
    }

    .. .and simply includes a 'value' with his 'name' associated field´s. The problem is: this method works, simply to have only 1 value - but any 'multiple value' form fields (for example your 'States' select or check box groups who spend several values as well) require a separate "foreach" in the script treatment, fields and this hasn´t been incorporated here.

    That said, I would suggest using another solution pre-made as PHP Form Mail script that s capable of managing your multiple values - scenario naturally.

  • Vary the accounts based on the selection of feature in data form

    Hi all

    I use Hyperion Planning 11.1.1.0.

    I have a problem by varying the members accounts on the dataform based on the selection of members of the entity of the dimension of the page.

    Currently, we use the Begbalance as a member (column) in the dataform and kept hidden. And we set the value of Begbalance-> actual values to zero for accounts that correspond to a specific entity...

    Then, on the form, I put 'delete missing data... That way I can show the accounts that should appear for an entity.

    But the list of members of the entity has more than 200, and thus also the accounts.

    Therefore, it is very tedious to do this adjustment for them...

    Someone please you suggest a better way to achieve the same * (i.e. different accounts on the dataform based on a selection of entity?) *.

    Kind regards.

    Alicia

    Hello

    You use the technique that a lot of consultants allows you to control what is displayed on a form.
    How do you set the values, if you have an excel template that you just update and then send the data to essbase it can facilitate the management of it a little.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Simple select for data based on a date

    Hi all

    I wrote data to a table and having problems try doing a select and obtain these data based on the query.

    I want to filter on a column called: TIMESTAMP based provided that the data has been written to the DB on the following date:

    OCTOBER 1 09 10.47.35.597914000

    I thought that would be enough:

    Select * from tableX
    where current_value = 999
    and TIMESTAMP = 1 October 2009"

    I know that the 999 exists because if I take the last line I get the data I want.

    A basic question I know, but any help much appreciated.

    Give the correct points then ;)

    No, I don't know how dangerous it is. The format is specified, the output should be straight (?) and he does not have the building fire the many times I've used it so far.

    Mike

  • Select data based on the priority of the State

    ID PRO_ID PRO_OBJ_ID TASK_ID DEVELOPER_ID STATUS
    121243 4940 37506 5250 6532 REJECTED
    122063 4940 37506 5250 6532 RELATIVES
    138306 4940 37506 5250 6532 ACCEPTED
    138307 4940 37506 5250 6532 WIP




    Hello

    In the table above, I need to select data based on the State, a status which precedes CLOSE or ACCEPTED it should display all status any State which is after CLOSE or ACCEPTED, we do not consider.


    In the scenioro above, it should display only the status of first three. After having ACCEPTED, it should not display something


    Please suggest me a request how to write.


    Thank you
    Sudhir.

    Try:

    SQL> with t as (
      2  select 121243 id, 4940 pro_id, 37506 pro_obj_id, 5250 task_id, 6532 developer_id, 'REJECTED' status from dual union all
      3  select 122063, 4940, 37506, 5250, 6532, 'CLOSE' from dual union all
      4  select 138306, 4940, 37506, 5250, 6532, 'ACCEPTED' from dual union all
      5  select 138307, 4940, 37506, 5250, 6532, 'WIP' from dual union all
      6  select 138308, 4940, 37506, 5250, 6532, 'ACCEPTED' from dual union all
      7  select 138309, 4940, 37506, 5250, 6532, 'REJECTED' from dual union all
      8  select 121243, 4940, 37777, 5250, 6532, 'REJECTED' from dual union all
      9  select 122063, 4940, 37777, 5250, 6532, 'CLOSE' from dual union all
     10  select 138306, 4940, 37777, 5250, 6532, 'ACCEPTED' from dual union all
     11  select 138307, 4940, 37777, 5250, 6532, 'WIP' from dual union all
     12  select 138308, 4940, 37777, 5250, 6532, 'ACCEPTED' from dual union all
     13  select 138309, 4940, 37777, 5250, 6532, 'WIP' from dual
     14  ) -- actual query starts here:
     15  select t1.id
     16  ,      t1.pro_id
     17  ,      t1.pro_obj_id
     18  ,      t1.task_id
     19  ,      t1.developer_id
     20  ,      t1.status
     21  from   t t1
     22  where id <= (select max(id)
     23               from   t t2
     24               where  t2.status in ( 'ACCEPTED', 'CLOSED' )
     25               and    t1.pro_id = t2.pro_id
     26               and    t1.pro_obj_id = t2.pro_obj_id
     27               and    t1.task_id = t2.task_id
     28               and    t1.developer_id = developer_id
     29               );
    
            ID     PRO_ID PRO_OBJ_ID    TASK_ID DEVELOPER_ID STATUS
    ---------- ---------- ---------- ---------- ------------ --------
        121243       4940      37506       5250         6532 REJECTED
        122063       4940      37506       5250         6532 CLOSE
        138306       4940      37506       5250         6532 ACCEPTED
        138307       4940      37506       5250         6532 WIP
        138308       4940      37506       5250         6532 ACCEPTED
        121243       4940      37777       5250         6532 REJECTED
        122063       4940      37777       5250         6532 CLOSE
        138306       4940      37777       5250         6532 ACCEPTED
        138307       4940      37777       5250         6532 WIP
        138308       4940      37777       5250         6532 ACCEPTED
    
    10 rows selected.
    

    If it works then please provide us with some representative sample data again.

Maybe you are looking for

  • Not all of a sudden, I can't send e-mail

    I can't send email, but I can receive. He always tells me that my password is incorrect, but it IS OK on my computer and if I connect via safari. What should I do? I need to be able to send e-mails!

  • Why my iMac (27 inch, mid 2011) cannot run Windows 10 in boot camp? And if he can't, he would work in something like parallels?

    Why my iMac (27 inch, mid 2011) cannot run Windows 10 in boot camp? And if he can't, he would work in something like parallels?

  • RS232 slow bed

    Hello I'm reading the information on a sensor RS232 [M.F. meter]. Everything works fine, but I think that my reading is slower than what the manufacturer says I should get. They said that the standard data frame is 43 characters in length and in the

  • Support universal adapter for M55 8808

    I have a Lenovo ThinkCentre M55 8808 desktop computer, and its hard drive died about two months ago. Fortunately, I had access to an old HP laptop that has had a few other parts that turned bad, but still had a good hard drive. The problem is that th

  • Installation of Xperia S themes

    Hi guys,. I have the Xperia Arc S & I'm trying to install this theme of http://forum.xda-developers.com/showthread.php?t=1448552 I got the udpate 5 downloaded, and I extracted the files. Found the system folder where the apk files where present. Fire