Dynamic list... select list with submit

Hi,
I am trying to create a dynamic list and based on the selection I want to pass the parameters… Here is what I’ve done so far
Step 1… created a list of values (through shared components) using a query
Step 2… created an item… used option to select list with submit…
Here is the challenge: How to update my P1_Value based on the value from Select list…
Thanks in advance

I've created a page process by following these steps
Create Page Process:
Category of the process: Session State
Session State process type: Set Preference to value of Item (PreferenceName:ITEM)
Point: On Submit after computation and validation
Preference Item: P1_Value
Getting an error message:
Invalid PL/SQL expression condition: ORA-06550: line 1, column 29: PLS-00306: wrong number or types of arguments in call to 'NVL' ORA-06550: line 1, column 7: PL/SQL: Statement ignored

Similar Messages

  • Dynamic lov, Select List in Report

    Hi all,
    I have searched the APEX forum for dynamic lov but somehow no topic could really solve my problem.
    I have a report and 2 columns in this report are displayed as a select list. I want one of the select list show some values depending on the other select list in this report. If the value of the first select list is equal to some data the second select list should show a lov and otherwise nothing.
    All examples i have found so far seem to explain a solution for a select list item on the page and not for a select list in a report like in my case.
    Are there any advices or some links you can give?
    Thanks in advance
    Markus

    See http://htmldb.oracle.com/pls/otn/f?p=18326:54:1415328128204513::::P54_ID:1282
    and http://forums.oracle.com/forums/thread.jspa?messageID=1222153&#1222153

  • Dynamically calling selection screens with obligatory

    TABLES :
    ******selection-screen: begin of block bal with frame title txt3.
    ******parameters: RB1  radiobutton group rd1 user-command abc default 'X'.
    ******parameters: RB2  radiobutton group rd1.
    ******selection-screen: end of block bal.
    ******selection-screen: begin of block B1 with frame title txt1.
    ******SELECT-OPTIONS  : s_cust  FOR KNA1-kunnr OBLIGATORY  MODIF ID r1.
    ******SELECT-OPTIONS  : s_plant  FOR plko-werks OBLIGATORY MODIF ID r1 .
    ******selection-screen: end of block val.
    ******selection-screen: begin of block upd with frame title txt2.
    ******SELECT-OPTIONS:  s_vend  FOR lfa1-lifnr OBLIGATORY modif id r2.
    ******SELECT-OPTIONS: s_plan  FOR plko-werks OBLIGATORY modif id r2.
    ******selection-screen: end of block upd.
    Here i need to call these two selection screens dynamically depends on radio buttion selection.
    But
    Problem is a arising when when both are obligatory in selection screen ( with out obligatory , it is working fine)
    I need to call screens dynamically, ecen though we have obligatory
    Let me know procedure , the possibility of same funcationality in tabstips & selection screen.
    Madhu

    Hi Madhu,
    You have to write code in AT SELECTION-SCREEN OUTPUT event.
    First of all remove obligatory from select-options declaration. Do it dynamically in AT SELECTION-SCREEN OUTPUT event.
    You enable or disable the block depending upon the rediobutton selected. Then in the venet AT SELECTION-SCREEN ON field, you can check whethere user has entered data into that field or not depending upon the radiobutton selected.
    TABLES : kna1,
             plko,
             lfa1.
    SELECTION-SCREEN: BEGIN OF BLOCK bal WITH FRAME TITLE txt3.
    PARAMETERS: rb1 RADIOBUTTON GROUP rd1 USER-COMMAND abc DEFAULT 'X'.
    PARAMETERS: rb2 RADIOBUTTON GROUP rd1.
    SELECTION-SCREEN: END OF BLOCK bal.
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE txt1.
    SELECT-OPTIONS : s_cust FOR kna1-kunnr  MODIF ID r1.
    SELECT-OPTIONS : s_plant FOR plko-werks MODIF ID r1 .
    SELECTION-SCREEN: END OF BLOCK b1.
    SELECTION-SCREEN: BEGIN OF BLOCK upd WITH FRAME TITLE txt2.
    SELECT-OPTIONS: s_vend FOR lfa1-lifnr MODIF ID r2.
    SELECT-OPTIONS: s_plan FOR plko-werks MODIF ID r2.
    SELECTION-SCREEN: END OF BLOCK upd.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF rb1 EQ 'X'.
          IF ( screen-name EQ 'S_CUST-LOW'
            OR screen-name EQ 'S_CUST-HIGH'
            OR screen-name EQ 'S_PLANT-LOW'
            OR screen-name EQ 'S_PLANT-HIGH') .
            screen-active = '1' .
          ENDIF.
          IF ( screen-name EQ 'S_VEND-LOW'
            OR screen-name EQ 'S_VEND-HIGH'
            OR screen-name EQ 'S_PLAN-LOW'
            OR screen-name EQ 'S_PLAN-HIGH') .
            screen-active = '0' .
          ENDIF.
        ELSEIF rb2 EQ 'X'.
          IF ( screen-name EQ 'S_VEND-LOW'
            OR screen-name EQ 'S_VEND-HIGH'
            OR screen-name EQ 'S_PLAN-LOW'
            OR screen-name EQ 'S_PLAN-HIGH') .
            screen-active = '1' .
          ENDIF.
          IF ( screen-name EQ 'S_CUST-LOW'
            OR screen-name EQ 'S_CUST-HIGH'
            OR screen-name EQ 'S_PLANT-LOW'
            OR screen-name EQ 'S_PLANT-HIGH') .
            screen-active = '0' .
          ENDIF.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    Regards,
    Anil Salekar

  • Dynamic Population of Select List

    I am stuck in a very frustrating situation at present, I need to dynamically populate select lists based on user choices.
    There are three drop down menus, only the first one is pre-populated with the other two populating upon user selection of the previous one. I am using JSP and JavaScript in conjunction. I need to make a function call to a back-end library which exists on a servlet to get the data for the 2nd and 3rd drop down menus, the parameter for the function being the user selected option in the 1st drop down menu.
    I know I cannot use the JavaScript "onchange" event handler as that won't help me call the back-end library functions. One way that I think is feasible at the moment is to do page refreshing, i.e. include other JSP's in one main JSP and refresh them as soon the user makes a choice. The other way is to embed an applet in a JSP page and use the JComboBox from the Swing libraries to detect events and make HTTP connections to servlets. I believe there is a possibility of using Struts to do this as well. Can someone tell me which would be the best method to use and a general overview of how to go about using it? I am also open to other alternatives...
    Thanx for any help in advance

    this can be done in two ways.
    one way:- try generating a hidden form fields with the values comma seperated.
    like <input type='text' id= id1 name = select1 value = 'coma seperated list of second select values' >
    on on change event you can get the list of values which you need to populate in the second select box. generate the options dynamically by splitting the coma seperated list into the second combo.
    second way:- while loading the jsp store all the second select box coma seperated list in java script array. and based on the change event of first select box get the corresponding values from the array and split them and generate the options dynamically and populate the second select box.
    I guess this way you can solve your problem.
    write back to me on [email protected] if you need code snippets.
    all the best
    kiran J

  • Select list and hidden display issue

    Hi all,
    I am using a dynamic value select list, which when a button is pressed sets the value of a hidden display item. The next page then uses the hidden display item as part of an SQL query.
    It strangely sometimes works and sometimes doesn't - it often struggles with the values in the select list which are over 30 characters.
    Does anybody have any idea what's going on?
    Many thanks,
    Tom

    Hi
    I just re-ran the debug feature and have found an issue which could be the cause of the problem:
    Som of the data items in the dynamic select list have and ampersand (&) symbol. If I run the page once the hidden item displays the value properly:
    0.22: binding: ":HIDDENREGION"="HIDDENREGION" value="Tech Comms Media Utilities & Hi-tech" if I re-run the page after navigating around the application for a bit is displays this value:
    0.22: binding: ":HIDDENREGION"="HIDDENREGION" value="Tech Comms Media Utilities &amp; Hi-tech"Please notice the "& amp;" bit which has been added... Is there any way of getting rid of this? as it is interfering with the query on the next page.
    Many thanks,
    Tom
    Edited by: new_to_apex on Mar 2, 2009 3:13 AM
    Edited by: new_to_apex on Mar 2, 2009 3:14 AM

  • Posible to start a report without a button, only i Select List ???

    Hi,
    another problem :)
    I have i lot of select lists in my aplication and the selectet items in the list are the values for my report. The problem is that i create a button for the select lists and when i click on the button the report was filled. Is there a option to start filling the report without the button ? I select the item in the list and now the report was filled with the values ? After the first select list i check the second. Select a value and the report is updated ?
    i hope someone understand my tricky question ^^"
    regards,
    Taki

    Create a lov
    Create a select item with submit referencing the same page
    Use the select with submit bindvariable as a bindvariable in the reportquery
    So when you select an item in the list, say the list has 4 values (1-4), eg. you select 2 in the selectlist with submit, the page redirects to itself putting the value 2 in the binvariable (the selectlist with submit), in the reportquery you refernce to the bindvariable in the where clause. Which contains the value 2. There are probably much more advanced ways to do this. Just started out myself. All the best. If it still isn't clear I give an even more thorough explination. Good luck.
    Message was edited by:
    Rik

  • Tile List selection after pressing embedded Image button

    Hi;
    I am working on SAP Work Manager 6.0 customizing using Agentry 6.1.3. I have this tile list that contains items. At the bottom of this tile list, I have a button that targets the selected item on the tile list. This button has an action which changes the icon  of the selected item when pressed and also executes an edit transaction that prints/changes the selected item property values based on rules. After selecting a particular item from the tile list and clicking on this button, the selected item's image changes to the image that I want, but the selection highlighter toggles and always moves to the first item on the tile list. I have tried implementing a list selection but it somehow always ignores this and always toggles back to the first item on the tile list. I would like it to stay on the selected item, whose image has just been changed. How would I go about having the selection highlighter stay on the same item before and after pressing the button?
    Your help is greatly appreciated!
    Thanks in advance!
    Sizo Ndlovu

    Hi Jason;
    Thank you for the prompt response.I'm using the .NET client to test on the development machine and the application is deployed onto an Android 4.0.4 device. I have tried implementing this as shown below:
    The action steps:
    The Navigation step:
    The List Selection step:
    The List Selection rule:
    I have also tried implementing this using the navigation only or the list selection only, with no success.
    Thanks and Regards;
    Sizo Ndlovu

  • Select list with submit using on a dynamic report

    Hi! I'd like to know how can I create a Select list with Submit using the HTMLDB_ITEM API.
    I know there's an API named HTMLDB_ITEM.SELECT_LIST_FROM_LOV(), but I'd like to know how can I reproduce in there the submit everytime the user changes a value.
    Thanks!

    Hi! I've discovered there's a parameter on this function that allows me to include a javascript like the example below:
    select HTMLDB_ITEM.SELECT_LIST_FROM_LOV(3, ctr_id,'LOV_COUNTRIES','onChange=javascript:doSubmit()','NO)
    from XXXX;
    The thing is I don't know how exactly this javascript:doSubmit() works, because it works different than creating a select list with submit item.
    If I create on a page a simple "select list with submit" item, and if I run the page, after changing the value of the select list it refreshes the page but it doesn't erase the values inserted on the other items. But if I have this HTMLDB_ITEM.SELECT_LIST_FROM_LOV function, after changing the value of the select list it refreshes the page but it erase the values inserted on the other items and recovers the old values..
    I really need your help on this.
    Thanks in advance :-)

  • Multiple Select List does not Refresh with Dynamic Action

    All,
    Scenario:
    Using APEX 4.2.2, I have a Select List page item (P4_SPONSOR) set to allow multiple values which has a dynamic LOV to populate the list.  What I would like to do is highlight the display values based on another page item's value (P4_DRIVER_ID).  When I set the source of P4_SPONSOR to static text, such as a delimited string of 1:2:3:4, any display values where the return values are equal to the static text are highlighted when the page loads.
    Problem:
    The problem lies in trying to use a query as a source for P4_SPONSOR which is filtered based on the other page item, P4_DRIVER_ID.  For instance, my SQL Query (returning colon separated values) returns the same as the static text noted above.  In the query's WHERE clause, I specify that the driver's ID is equal to P4_DRIVER_ID:
    SELECT sponsor_id
    FROM sponsors_drivers_xref
    WHERE driver_id = :P4_DRIVER_ID;
    This, as I understand it, would necessitate a refresh of P4_SPONSOR whenever the value of P4_DRIVER_ID changes.  So, I have a Dynamic Action that does just that.  When executed on the page, I can see the P4_SPONSOR multiple select list actually refresh, but none of the display values become highlighted.
    Thoughts?
    Thanks,
    -Seth.

    Seth,
    A dynamic action refresh of your select list will refresh the list of values (this is what you are seeing), it will not refresh the value of the item itself.  In fact, it will remove any values that you had already selected.  To refresh the value you will need to add additional dynamic actions.
    Create another dynamic action with:
    Event: After Refresh
    Selection Type: Item(s)
    Item(s): P4_SPONSOR
    If this was a normal select list you could just create a Set Value action and use your query to set the value of the select list.  Since this is a multiple select list your will need to get your colon delimited value first and then use some javascript to set the values of your select list.
    Create an hidden page item name P4_SPONSOR_TEMP.
    Add a true action to your new dynamic action:
    Action: Set Value
    Set Type: SQL Statement
    SQL Statement:
    SELECT sponsor_id
    FROM sponsors_drivers_xref
    WHERE driver_id = :P4_DRIVER_ID;
    Page Items to Submit: P4_DRIVER_ID
    Selection Type: Item(s)
    Item(s): P4_SPONSOR_TEMP
    Add another true action to your new dynamic action:
    Action: Set Value
    Set Type: JavaScript Expression
    JavaScript Expression:
    $("#P4_SPONSOR_TEMP").val().split(":")
    Selection Type: Item(s)
    Item(s): P4_SPONSOR
    --Jeff

  • Can we have the 'select list with submit' type within a tabular form?

    An item can be the "Select list with submit' type so a form has no problem with it. However, when I built a tabular form manually, I couldn't find this type. There are only three types avaiable: "named", "static", and "dynamic".
    Is it possible to have the "submit" type so columns of the tabular form can be dynamically rendered based on the user inputs?
    Another question I have is how to dynamically build the tabular form with decode func. For example, if the value of col_1 is 'val_1', then build a select list in col_2; otherwise null in col_2.
    I tried to use
    select col1,
    decode (col1, 'val_1', select htmldb_item.select_list_from_lov(2, first, 'lov1') from dual, null)
    from....
    where....
    But it didn't work.
    I'd like to know whether it's feasible to have something like that.
    TIA.
    Message was edited by:
    Luc

    You could use a region of type PL/SQL function
    returning SQL query to dynamically build this kind of
    tabular form. However if you want to use the built-in
    multi-row insert, update and delete processes, all
    items in a column must have the same display type. Marc, thanks for the quick reply. I appreciate it.
    I got your idea. However, I need to have the javascript 'ToggleAll' as the heading so the form works as same as the built-in one. If I put the query definition into a pl/sql procedure, where I can put this html tab attribute? It can not be inside the checkbox function, otherwise the checkbox of any row would act as same as the header.
    I hope I've made this clear.
    To Vikas: It's our clients who want this, not us. :(

  • Update select list with dynamic LOV

    How exactly do you do this?
    Currently I have a text field which the user may enter a product type and a button when click. It would populate the select list with the product names that associate with that product type...
    My lov would retrieve the product type value text field(:P1_t_prod_type) and get products names by type
    select t_prod_name A , t_prod_name B
    from t_prod_items
    where t_prod_type = :P1_t_prod_type
    order by 1Im kind of stump on is setting up my dynamic action to "set value" to the select list. As nothing seems to be appearing.

    product type is a numeric value that can be a wide numeric range. (I don't know why the column is named like that. Sorry for forgetting to mention that)
    Well I don't think i should submit the page? because after the list box is filled with product names. the user can then select one of those names from the list box and continue completing the rest of the form. After all that the page would then be submited. (Well that's how i imagine it to work...)
    Wouldn't i run into problems if i were to submit the page twice... like lost entry in other text fields if the user were to skip that part at the start.

  • Select list with submit issue when they are referred in report region query

    I have a page with a reporting region. Same region also has 3 different list items and depending on the value selected in each item, the report is refreshed. All the 3 list items are "Select list submit with submit"
    Out of 3 items, 2 (say item2 and item3) are populated through dynamic LOV using the value in item1.
    Additionally, when I select a default "ALL" value in in item1, I ignore values in item2 and item3.
    With this background, I am a following issue:
    1. I select a value other than Default value in item1 which filters the report.
    2. Then I select some value in item2 which further shrinks the reports.
    3. Now if I go back to item1 and select the default "All" value, the report is not refreshed with the new values of item1, item2 and item3. But it still shows the report based on value of item2 that I selected in step2.
    How do I set the value of item2/item3 to null if value of item1 is default which is "All"
    Any word of advise will be a great help!
    Thanks,
    Girish

    Hi,
    Make two computations each with the computation text NULL; or
    Make one process with code like:
    BEGIN
    :P1_ITEM2 := NULL;
    :P1_ITEM3 := NULL;
    END;With the condition "Value of Item in Expression 1 = Expression 2"
    Expression 1: P1_ITEM1
    Expression 2: ALL
    (or whatever the return value of ALL is...remember that this is case sensitive)
    Mike

  • Chart based on Select list with submit Lov problem

    Hi,
    I have one page with interactive report showing username with links, date and
    database actions.
    Another page contains one region having flash chart based on select list with submit Lov.
    The lov is created by dynamic query.
    Every time when i click the 1st page report link, the 2nd page lov is populating the value automatically. But the problem is chart displays NO DATA FOUND message though the LOV has many values.
    I don't want to display any null values so set to NO for LOV
    I tried to write Before header computation (PL/SQL Function Body) to set the lov value, but the query is displayed as such.
    I don't want to assign any static default value also as the values are dynamic for every link.
    The following is my Before header computation of Select list with submit (Item name is p11_schema). (PLSQL Function Body)
    begin
    if :p11_schema is null then
    return 'select distinct owner schema1, owner schema2 from auditing
    where access_date=' || :p11_access_date
    || ' and username=' || :p11_username
    || ' order by owner';
    end if;
    end;
    This is my chart query.
    select null link, obj_name label, sum(sel_count) "Select", sum(ins_count) "Insert", sum(upd_count) "Update", sum(del_count) "Delete" from auditing
    where username=:p11_username
    and access_date=:p11_access_date
    and owner=NVL(:p11_schema, OWNER)
    group by owner, obj_name
    Example: If there more than one records in the lov, the graph should display the 1st record. When i select another record, the chart accordingly display the selected values. But inially it should not display "NO DATA FOUND" message.
    I tried using all the combinations of computation type for the lov, SQL query ( I could not use if conditon then), PLSQL expression, PLSQL function body. But it does not work out.
    Can anyone please help me out.
    Thanks.

    Hi Scott,
    Thanks for your reply.
    I found out the solution for this problem as below.
    But i did it in different way to tackle the dynamic query wich returns more than one record using rownum always the 1st record when it is empty instead of assigning constant (static) value like '1'. And i am returning LOV itself for both null or not null condition as below.
    Declare
    q varchar2(4000);
    begin
    if :p11_schema is null then
    q:='select distinct owner schema from auditing';
    q:=q || ' where username=:p11_username ';
    q:=q || ' and access_date=:p11_access_date ';
    q:=q || ' and rownum<2 order by owner';
    Execute immediate q into :p11_schema USING :p11_username, :p11_access_date;
    end if;
    return :P11_SCHEMA;
    end;
    Thanks.

  • How to fix "Select List with Submit" Problem

    I have a report with two regions. Region1 has a list item which is set to "Select List with Submit". Based on the list/item value selected in the Region1, the data is displayed in the Region 2.
    Question: How do I ge the report, Region2, to have the data populated based on the first value in the list when the page is loaded - for the first time. Currently, when the page is accessed, the list has the first value selected in the Region1 list item by default, but the Region2 is blank.
    DP
    Edited by: user4115675 on Jan 14, 2010 9:37 AM

    Earl, please see the response in italics for each of your questions below:
    You do want your default value to be one of the values in the select list. Otherwise why would you want the value there at all?
    So, then should I have a default value at all? And, if yes, then what should it be?
    And can't you just set the default value to the first value in your select list, whatever that is, so the first value is the selected value?
    I did that and it works, only if the first value in the select list is always going to be there.  The select list is based on a column data in a table.  And if the data for that column changes then the values in the select list will change.  And, the first value might not always be the same.
    I guess I'm not clear why this isn't doing what you want, besides the fact that
    you seemed to have removed the default value from the dynamic select list query, which you shouldn't do.
    I removed the first value (it could have been any values) from the select list to mimic the "dynamic" select list -- just to test.  The select list data is based on a table and the data in the table can change.
    Thanks
    DP

  • Dynamic select list with more than one value?

    I am creating a simple CRUD component for our company's Joomla site. This component allows our users to create discount bundles for our cart according to shopper group and products.  I've been using Dreamweaver to author the administrator forms and have run into a bit of a problem.  All of my forms work properly, but I need to be able to collect two values from each chosen multi-select listing. 
    Right now, when a user chooses an item under 'products', the site pushes back product_id, one of the variables I need.  I would also like product_parent_id to return with each result as well.  I need to be able to insert product_parent_id after the user has chosen their desired products.  product_parent_id is located in the same table as product_id.
    In the end, I need those two values to be pushed to another table, essentially creating a new entry for each product in the bundle.  Referenced by ID and parent ID.
    Pasted below is the administrator form code.  Any suggestions would be wonderful.
    Thanks!
    <?php require_once('Connections/SQLTest.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO jos_vm_related_products (product_id, related_product_id) VALUES (%s, %s)",
                           GetSQLValueString($_POST['products'], "int"),
                           GetSQLValueString($_POST['products'], "int"));
      mysql_select_db($database_SQLTest, $SQLTest);
      $Result1 = mysql_query($insertSQL, $SQLTest) or die(mysql_error());
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO jos_vm_relations (discount_type, discount, shopper_group_id) VALUES (%s, %s, %s)",
                           GetSQLValueString($_POST['amount_off_total'], "text"),
                           GetSQLValueString($_POST['dollar_amount'], "int"),
                           GetSQLValueString($_POST['shoper_group'], "int"));
      mysql_select_db($database_SQLTest, $SQLTest);
      $Result1 = mysql_query($insertSQL, $SQLTest) or die(mysql_error());
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO jos_vm_relations_messages (discount_message) VALUES (%s)",
                           GetSQLValueString($_POST['discount_message'], "text"));
      mysql_select_db($database_SQLTest, $SQLTest);
      $Result1 = mysql_query($insertSQL, $SQLTest) or die(mysql_error());
    $maxRows_Products = 10;
    $pageNum_Products = 0;
    if (isset($_GET['pageNum_Products'])) {
      $pageNum_Products = $_GET['pageNum_Products'];
    $startRow_Products = $pageNum_Products * $maxRows_Products;
    mysql_select_db($database_SQLTest, $SQLTest);
    $query_Products = "SELECT * FROM jos_vm_product";
    $query_limit_Products = sprintf("%s LIMIT %d, %d", $query_Products, $startRow_Products, $maxRows_Products);
    $Products = mysql_query($query_limit_Products, $SQLTest) or die(mysql_error());
    $row_Products = mysql_fetch_assoc($Products);
    if (isset($_GET['totalRows_Products'])) {
      $totalRows_Products = $_GET['totalRows_Products'];
    } else {
      $all_Products = mysql_query($query_Products);
      $totalRows_Products = mysql_num_rows($all_Products);
    $totalPages_Products = ceil($totalRows_Products/$maxRows_Products)-1;
    mysql_select_db($database_SQLTest, $SQLTest);
    $query_shopper_group = "SELECT * FROM jos_vm_shopper_group";
    $shopper_group = mysql_query($query_shopper_group, $SQLTest) or die(mysql_error());
    $row_shopper_group = mysql_fetch_assoc($shopper_group);
    $totalRows_shopper_group = mysql_num_rows($shopper_group);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <form id="form1" name="form1" method="POST" action="<?php echo $editFormAction; ?>">
      <p>
        <label for="products"></label>
      Choose the product(s) you would like to add to your new discount bundle.</p>
      <p>
        <select name="products" size="1" multiple="MULTIPLE" id="products">
          <option value=""></option>
          <?php
    do { 
    ?>
          <option value="<?php echo $row_Products['product_id']?>"><?php echo $row_Products['product_name']?></option>
          <?php
    } while ($row_Products = mysql_fetch_assoc($Products));
      $rows = mysql_num_rows($Products);
      if($rows > 0) {
          mysql_data_seek($Products, 0);
      $row_Products = mysql_fetch_assoc($Products);
    ?>
        </select>
      </p>
    <p>
      <input type="hidden" name="hiddenField" id="hiddenField" />
      </p>
      <p>Choose the subscriber group that you would like this discount to apply to.</p>
      <p>
        <select name="shoper_group">
          <?php
    do { 
    ?>
          <option value="<?php echo $row_shopper_group['shopper_group_id']?>"><?php echo $row_shopper_group['shopper_group_name']?></option>
          <?php
    } while ($row_shopper_group = mysql_fetch_assoc($shopper_group));
      $rows = mysql_num_rows($shopper_group);
      if($rows > 0) {
          mysql_data_seek($shopper_group, 0);
      $row_shopper_group = mysql_fetch_assoc($shopper_group);
    ?>
        </select>
      </p>
      <p>Please enter the dollar amount that you would like to adjust.
        <label for="dollar_amount"><br />
        </label>
        <input type="text" name="dollar_amount" id="dollar_amount" />
      </p>
      <p>
        <input name="amount_off_total" type="hidden" id="amount_off_total" value="amount_off_total" />
      </p>
      <p>Enter any message you would like the shopper to view during shopping and checkout when this discount is applied.</p>
      <p>
        <label for="discount_message"></label>
        <textarea name="discount_message" id="discount_message" cols="45" rows="5"></textarea>
      </p>
      <p>
        <input type="hidden" name="MM_insert" value="form1" />
      </p>
      <p>
        <input type="submit" name="submit" id="submit" value="Submit" />
      </p>
    </form>
    <br />
    </body>
    </html>
    <?php
    mysql_free_result($Products);
    mysql_free_result($shopper_group);
    ?>

    Thanks guys for you reply , [Cor Ligthert] I post this in Visual basic section, I appreciate your solution [dbasnett],
    Thanks for that idea of attribute <Flags> [Blackwood] ,
    Dictionary will not work in IF Statement as I want it , also ParamArray tbl() , thanks guys.
    Here is the code
    Module myModule
    <Flags()>
    Enum Table As Integer
    Table1 = 2
    Table2 = 4
    Table3 = 8
    Table4 = 16
    Table5 = 32
    End Enum
    Public Sub MySub(ByVal Table As Table)
    If (Table And Table.Table1) = Table.Table1 Then
    MsgBox((Table And Table.Table1))
    End If
    If (Table And Table.Table2) = Table.Table2 Then
    MsgBox((Table And Table.Table2))
    End If
    If (Table And Table.Table3) = Table.Table3 Then
    MsgBox((Table And Table.Table3))
    End If
    If (Table And Table.Table4) = Table.Table4 Then
    MsgBox((Table And Table.Table4))
    End If
    If (Table And Table.Table5) = Table.Table5 Then
    MsgBox((Table And Table.Table5))
    End If
    End Sub
    End Module
    Class Myclass
    Private sub CallTables()
    MySub(Table.Table1 Or Table.Table2)
    MySub(Table.Table2 Or Table.Table3 Or Table.Table4)
    MySub(Table.Table1 Or Table.Table4 Or Table.Table5)
    MySub(Table.Table1 Or Table.Table2 Or Table.Table4 Or Table.Table5)
    MySub(Table.Table1 Or Table.Table2 Or Table.Table3 Or Table.Table4 Or Table.Table5)
    end sub
    end Class

Maybe you are looking for