Check Box checked

I am developing a small program in VB 2008. In my application there is one MDI form its child forms. On MDI form ToolStrip there is one button "Save". In child Form "Child1" there one Panel "Panel1" in which 20 check box are
there from "cb1 to cb20". After selecting few of the check boxes when I press Save button of MDI Toolstrip I need to save the names of check boxes in a table with comma delimiter. But I am not getting the desired out put from the code what I have
written. the code sample in given below
Update_Record in called form the button click even of SAVE button and I is a public variable
Public Sub Update_Records()
Dim X
As
Integer
For X = 1
To 20
            I = X         
Dim Str
As
String =
"CheckBox" &
CStr(X.ToString)
cb=DirectCast(Me.Controls(Str),
CheckBox)
AddHandler Cb.CheckedChanged, cb_CheckedChanged(Cb, Cb.CheckStateChanged)
If Cb.Checked
Then
                MsgBox("Checked")
End
If
Next
End
Sub
Public
Sub cb_CheckedChanged(ByVal
sender As
Object,
ByVal e
As EventArgs)
If Cb.Checked
Then
            Rcpt &= I
End
If
End
Sub

After selecting few of the check boxes when I press Save button of MDI Toolstrip I need to save the names of check boxes in a table with comma delimiter.
You indicate that the expected result will be a comma-delimited string, but you aren't adding the commas.  The code to create a comma-delimited string would be
            Rcpt &= I & ","
but if you wanted the list of control names, not just the numbers, it would be
            Rcpt &=
"CheckBox" &CStr(I.ToString)
That would work if Rcpt is a global variable that you can access to save to the table.  However, the real problem is that the code to test the checkboxes is in the CheckChanged event handler, which isn't relevant to the Save process.  CheckChanged
is invoked when the user clicks the checkbox to change its value - that's not happening here.  Your code should be
Public Sub Update_Records()
Dim X As Integer
For X = 1 To 20
Dim Str As String = "CheckBox" & CStr(X.ToString)
cb=DirectCast(Me.Controls(Str), CheckBox)
If Cb.Checked Then
Rcpt &= cb.name & ","
End If
Next X
End Sub
As good practice you should declare UpdateRecords as a function and return a result, rather than updating a global variable.  It also seems like poor design to record the names of controls on the form - the application should be indifferent to something
internal like the names you have chosen in the designer.

Similar Messages

  • Hiding text box based on check box checking

    Hello,
    I have a jsp in which based on whether the check box is checked or unchecked I want to hide or show a text box. I am including the text box in a div tag & calling a javascript function to set the style of the div to hidden or shown based on whether the check box is checked or not. although i am getting the correct values in the alerts the text box is not getting hidden.
       <td class="label"><label for="chk1"><gbms:message key="lblSearchforDeletedCustomer"/>:</label></td><td class="input">
                  <html-el:checkbox property="chk1" value="N" tabindex="3" onclick="javascript:checkboxClicked(document.forms['formCustomerOrVehicleMaintenance'])" onfocus="fnShowError(document.formCustomerOrVehicleMaintenance.chk1);"></html-el:checkbox> <gbms:message key="chek"/> 
                                 </td>
                                 <div id="delDateDiv" style:hidden>
                            <td class="label"><label for="txtDeleteDate"><gbms:message key="lblDeletedAsOf"/>:</label></td><td class="input">
                 <html-el:text property="txtDeleteDate" size="6" maxlength="40" tabindex="3" onchange="fnChanged()" onfocus="fnShowError(document.formCustomerVehicleMaintenanceDelete.txtDeleteDate);"></html-el:text> <a href="#" onclick="cal1xx.select(document.forms[0].txtDeleteDate,'anchor1xx','MMddyy'); return false;" name="anchor1xx"><img src="<%=request.getContextPath()%>/css/common/calendar.gif" border="0" style="cursor: hand"></a><gbms:help jsp="customerVehicleMaintenanceDelete" module="admin" languageCode="<%=request.getLocale().getLanguage()%>" field="DeletedAsOf"/>
                        </td></div>javascript function being called..
    function checkboxClicked(aThis)
                        var aform = document.forms['formCustomerOrVehicleMaintenance'];
                        var aDiv = document.getElementById('delDateDiv');
                        alert(aDiv.style.visibility);
                        alert(aDiv.innerHTML);
                        alert(aform.chk1.checked);
                        if(aThis.chk1.value == true)
                             aform.txtDeleteDate.value = '';
                             aform.txtDeleteDate.disabled = false;
                             aDiv.style.visibility = 'visible';
                        else
                             aform.txtDeleteDate.value = '';
                             aform.txtDeleteDate.disabled = true;
                             aDiv.style.visibility = 'hidden';
                   }

    in my javascript function the value returned is true when checkbox is checked & false when it is unchecked. visibility is also giving correct value in the alert. but still field is not hiding
              function checkboxClicked()
                        var aform = document.forms['formCustomerOrVehicleMaintenance'];
                        var aDiv = document.getElementById('delDateDiv');
                        alert(aDiv.style.visibility);
                        alert(aform.chk1.checked);
                        if(aform.chk1.checked)
                             aform.txtDeleteDate.value = '';
                             aform.txtDeleteDate.disabled = false;
                             aDiv.style.visibility = 'visible';
                             alert("inside if");
                             alert(aDiv.style.visibility);
                        else
                             aform.txtDeleteDate.value = '';
                             aform.txtDeleteDate.disabled = true;
                             aDiv.style.visibility = 'hidden';
                             alert("inside else");
                             alert(aDiv.style.visibility);
                   }

  • Want check box checked as default for a newly added subscreen in ME21N

    Hi Guys,
                 I have added a subscreen in ME21N with one field with check box.
    When I enter ME21N I should get that checkbox CHECKED automatically.
    How to do this.
    And one more thing is when manually putting checkmark,when I press enter that check mark is getting deselected.How to overcome this???
    I have used screen exit
                                      SAPLXM06 
                                      screen: 0101   for this subscreen.
    Thanks in Advance.
    Prasad.

    Hi,
    the deselection problem could be caused of an incorrect name of that screen field name. You should check in screen painter if that check box field name is the same name as your data object (e.g. gv_checkbox) .
    Unfortunately it is not possible to define default values within Screen Painter. You have to do this in PBO.
    Regards
    Mark-André

  • Grey out the input field as soon as check box checks on selection screen!

    HI Experts,
    In my report selection screen I have input_field1, input_field2, check_box1. Both input fields are mandatory fileds.
    My requireemnt is: If user as soon as checks the check_box1, the first input_field1 must go grey out (not allow allow to enter)!
    So I have assigned a user command to check box and assigned a modif-ID to the input_field1
    and wrote a LOOP AT SCREEN code as below,
    PARAMETERS show_all AS CHECKBOX USER-COMMAND flag.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS: p1 TYPE c LENGTH 10,
                p2 TYPE c LENGTH 10,
                p3 TYPE c LENGTH 10.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
    PARAMETERS: p4 TYPE c LENGTH 10 MODIF ID bl2,
                p5 TYPE c LENGTH 10 MODIF ID bl2,
                p6 TYPE c LENGTH 10 MODIF ID bl2.
    SELECTION-SCREEN END OF BLOCK b2.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF show_all <> 'X' AND
           screen-group1 = 'BL2'.
           screen-active = '0'.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    But,am getting an error message saying "Enter all required fields"
    Pls. let me know how to fix this?
    Thank you

    I assume P1, P2 and P3 are marked as obligatory.
    You cannot achieve that. But here is an alternative to achieve a similar functionality.
    AT SELECTION-SCREEN.
      CHECK sy-ucomm EQ 'ONLI' OR sy-ucomm = 'SJOB' OR sy-ucomm = 'PRIN'.
      IF p1 is INITIAL or P2 is INITIAL or P3 is INITIAL.
        MESSAGE 'Enter all required fields' TYPE 'E'.
      ENDIF.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF show_all = 'X' AND
           screen-group1 = 'BL2'.
          screen-input = '0'.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.

  • How to update field when check box checked

    Hi All,
    I am using oracle Forms 10g,
    I have a block with 20 fields.So first 10 Fields are not updatable and remaining are Editable. So the user will enter the Data and changes the data.And check the Check box and save the data.
    Inside the save button i have written the update code.
    When the user Edit two or three records and click three Check box and click the save button only one record is getting entred in my custom table.
    This is my code please correct me where i went worng.
    This is my code inside my button
    declare
    Begin
    If :ASSEMBLIES_BLOCK.CHECK_IN_OUT='Y' THEN
    IF SHOW_ALERT ('UPDATE_ALERT') = alert_button1 THEN
    LOOP
    XXTLX_PO_LOGOSTICS.XXTLX_PO_LOGOSTICS_UPDATE;
    EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
    NEXT_RECORD;
    END LOOP;
    STANDARD.COMMIT;
    fnd_message.set_string ('Transaction Saved Successfully');
    fnd_message.show;
    ELse
    NULL;
    END If;
    END IF;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    NULL;
    WHEN OTHERS
    THEN
    NULL;
    END;
    I have write a procedure in program unit.
    XXTLX_PO_LOGOSTICS.XXTLX_PO_LOGOSTICS_UPDATE
    Assemblies block is my current block that user enter the data and click the check box and save the data.
         Update XXTLX_PO_ASSEMBLIES set CASE_NO=nvl(:assemblies_block.CASE_NO,Null),
              PACKAGE_TYPE=nvl(:assemblies_block.PACKAGE_TYPE,null),
              PACKAGE_QTY=nvl(:assemblies_block.PACKAGE_QTY,Null),
              GROSS_WT=nvl(:assemblies_block.GROSS_WEIGHT,Null),
              OPI_DATE=nvl(:assemblies_block.OPI_DATE,Null)               
              Where ponum=:DETAIL_BLOCK.PO_NUMBER
              AND PO_LINE_NUM=:DETAIL_BLOCK.LINE_NUM          
              AND BOM_NO=:assemblies_block.BOM_NO;
    So when we click the multiple check box and save the data only one data is entering.
    Thanks & Regards
    Srikkanth

    I guess I don't understand.
    >
    ... my requirement is only the checked fields need to get updated. If in a block there are 10 records means ill update only the 3rd and 4th record and then click the check box.. and then ill click the save button.
    >
    Is this block a database block or a non-database block? If it is a database block then Oracle can handle updates to that block for you because if keeps tabs if a record was updated or not and you wouldn't need to do an UPDATE statement.
    If it is a non-database block, and you are looping through each record and only updating the items that have checkboxes next to them you would still have to go to the first record then step through each record and see if it needs to be updated. I am just guessing here because I don't think I have a good grasp on what you are doing, but you could change your XXTLX_PO_LOGOSTICS.XXTLX_PO_LOGISTICS_UPDATE package to only update the items that have checkboxes next to them, by checking each checkbox:
    -- Check Case No
    if nvl(:assemblies_block.chase_no_check,'N') = 'Y' then
      update xxtlx_po_assemblies
         set case_no = :assemblies_block.case_no
       where ponum = :detail_block.po_number
         and po_line_num = :detail_block.line_num
         and bom_no = :assemblies_block.bom_no;
    end if;
    -- Check Package Type
    if nvl(:assemblies_block.package_type_check,'N') = 'Y' then
      update xxtlx_po_assemblies
         set package_type = :assemblies_block.package_type
       where ponum = :detail_block.po_number
         and po_line_num = :detail_block.line_num
         and bom_no = :assemblies_block.bom_no;
    end if;
    -- Check Package Qty
    .

  • I/O field grayed out after check box checked ( Dynpro)

    Hi ,
    I have dynpro  dialog screen  with several check boxes linked with input/output field
    When check box is checked the I/O field is editable when check box is empty I/O field should be grayed out.
    I am trying to find the way how checking the check box can trigger the change of attribute of I/O field.
    The IO field should be gray out after checking check box without hitting enter or any other button.
    Please advice
    Chris

    Hi ,
    Thank you for your answer. I was missing Functional code of my check boxes.
    Now i have still issue my I/O field do not turns in gray ( only output) In loop
    I dide like you said ( this is example from my PAI module user-command)
    when 'CB1'.
          loop at screen .
            if screen-name = 'LT_FORMAT_IO'
              and lt_format_cb is initial.
              screen-input = '0'.
              screen-invisible = '1'.
              modify screen.
            endif.
          endloop..
    Once screen is displayed again , the IO field stll remains non grayed out.
    Please advice
    Chris

  • Freezing document unless check box checked

    I need to stop a user from continuing to fill out a form unless they check a required check box.
    Where can I find out how to do this?

    if check_box = 'X'. " then it should only send messages not posting
      call functiona module for BAPI BAPI_ACC_DOCUMENT_CHECK.
    returns bapiret2 ..here messages will be there
    else.
    call function for post. you may use BAPI BAPI_ACC_DOCUMENT_POST.
    this one also returns messages. success and error
    endif.

  • Hot Synch does not work, Treo 755p, USB, 17" Mac Pro Laptop, even with RevD installed and Allow other HotSynch applications preference check box checked

    Hi,
    I am a long time Palm enthusiast who is frustrated.  No more Palm products for me or anyone I speak to until I solve this problem.  Someone at Palm should be paying attention to their long time cusotmers.  I bought Palms in 2002 and 2003.
    The support literature coming with two Treo 755p that I bought was so poor that never saw the fine print that there was three months of support if I registered the devices.  The registration page does not let me register.  All the fields are ghosted after I put in the serial number.  I bought one in June 2008 and the other in early 2008.  So never registered and can get no help from Palm now it seems.
    So beside that gripe below is the problem issue info.
    I can't get a Verizon Treo 755p to USB cable Hot Synch with my daughters 17" Mac Pro Laptop.  It is using OS 10.5x  She lives in another city so I am trouble shooting this remotely.
    Did - Revd Palm upgrage has been installed.
    PalmDesktopMac421Revd.dmg (17MB)
    http://kb.palm.com/SRVS/CGI-BIN/WEBCGI.EXE/,/?St=4518,E=0000000000255177998,K=6239,Sxi=3,case=obj(33...
    Did in advanced settings on the Treo select in the Synch preferences allow other Hot Sync applications.
    That process worked however on my own Treo 755p Verizon as below:
    After much work, hours over several months, I got my my Treo 755p Verizon to Hot Synch with a QuickSilver desk top Mac running os 10.5x. 
    Did the RevD upgrade.
    Did in advanced settings on the Treo select in the Synch preferences allow other Hot Sync applications.   Otherwise the Wireless Synch feature prevents a Hot Synch.
    Once those both were done than Hot Synch works fine, and Wireless Synch works fine and does not interfere.
    The Wireless on both PDAs is scheduled to be removed on both Treos due the economy on Feb. 4th, so I would like the HotSynch to be working so her Treo is backed up.
    Thanks so much to anyone who replies to help out.
    Best
    Post relates to: Treo 755p (Verizon)
    Post relates to: Treo 755p (Verizon)
    This question was solved.
    View Solution.

    Works now, she had created a user ID as prompted when installing the HotSynch Software, but it was not the same name of the Treo 755p.  The default ID was the one she from installing the software, so it showed nothing in address or contacts, but when she switched to the Treo ID than all her stuff was there.
    Post relates to: Treo 755p (Verizon)

  • Passing check box values to WHERE clause

    Hi,
    I have created a Data block - 'CONTACTS' (Database data block)
    and has database item - 'Code', 'Descr'
    The number of records displayed is set to 5.
    Value When checked - 'Y'
    Value When Unchecked - 'N'
    Check box mapping of other values - 'unchecked'
    I am writing the code inside 'WHEN BUTTON PRESSED'. My main objective is to return the count of records based
    based on several conditions and one among them is CODE which is can be single or multiple based on the check box checked.
    The requirement is when i check one or multiple checkboxes, i should pass the 'Code' item values to the WHERE clause.
    Right now whenver i am trying to do so, only the current record value is copied to the WHERE clause.
    I have tried using basic loop but things havnt worked.
    Logic tried with basic LOOP
    BEGIN
    GO_BLOCK('CONTACT');
    IF :contact.cb = 'Y' THEN
    LOOP
    IF p_where is null then
    p_where := :contact.code;
    else
    p_where := p_where ||','||:contact.code;
    end if;
    exit when :system.last_record = 'TRUE';
    next_record;
    END LOOP;
    end if;
    MESSAGE ( 'p_where :'||p_where);
    MESSAGE (' ');
    END;
    And Even if i write the LOOP before the first IF, it return me the current record value and move to the last record.
    please guide me where am i wrong.
    Regards.
    Anoop.

    Try something like this:
    FIRST_RECORD;
    LOOP
      IF :contact.cb = 'Y' THEN
        IF p_where is null then
           p_where := :contact.code;
         else
           p_where := p_where ||','||:contact.code;
         end if;
       END IF;
      exit when :system.last_record = 'TRUE';
      next_record;
    END LOOP;
    -- END LOOP;
    MESSAGE ( 'p_where :'||p_where);
    MESSAGE (' ');
    END;

  • Unlimited Delivery Check box in PO

    Dear all,
    We are facing one issue. In service PO we found one field 'Over Delivery" field and one check box  "Unlimited Delivery". For service we are finding that by default we are getting "unlimited Del" check box checked and system is not allowing to input overdelivery %.
    Is there any setting in spto or master data for which it is getting defaulted?
    Regards,
    Santosh

    hi
    goto IMG --> MM --> purchasing --> Purchase Order --->
      define screen layout at document level
    there select ME21N and click on details at application toolbar and there in GR/IR selection group maintain overdelivery tolerance as optional field .
    now this will allow you to input overdelivery tolerance
    reward points if helpful
    regards
    chetan

  • How can I use if with a check box to perform a formula?

    I would like to have a column with a cheek box which, if ticked, performs a formula in the next column. Would anyone know how to do this?

    Is this what you mean?
    B1=IF(A1=TRUE, C1+D1, "")
    this is shorthand for select cell B1, then type (or copy and paste from here) he formula:
    =IF(A1=TRUE, C1+D1, "")
    Check box not checked:
    Check box checked:
    when the checkbox is checked cell B1 will contain the sum of cells C1 and D1 otherwise cell B1 is empty

  • Multiple check boxes in an update form using php

    I have a database of the membership of a club. One field in the database is input by checking multiple check boxes. When the insert member record is submitted and multiple check boxes are selected, the information becomes an array of text separated by commas. When the user goes back to the update form, the check boxes are not showing checked in the appropriate fields. Please go to my test site where you will be able to see the code that I have created so far: http://www.usreboot.com/phphelp.php. You will find the php code for the update form in a pdf file located there. You will need a user name and password to look at the update record page. Here you go: user name: wyane, password: wayne. I have submitted this request in the past and have not found success so far. Thanks for your help, Wayne Rowlands

    I am so close. If a member has only one check box checked. I get the check box checked in the update form. Here is the updated code:
    If the member has a number of check boxes checked, none of the check boxes are checked. I am so close. Maybe you can figure out what I am missing.  Thanks, Wayne

  • (Smartform)check box display in a table....very urgent

    Hi..
    i inserted check box by going to <b>sap symbols and inserted check box</b> but i am unable to see print preview and also in the printout.
    Can any one tell me how to insert check box in a <u><b>table.</b></u>
    your help will be appreciated.<b></b>

    Hello,
    As discussed earlier in many posts, it is better you load a graphic for Check box ( Checked and Empty ) is Tx SE78. You can create .bmp files for the same in MS paint.
    In a table node in the SSF, every line in the table will be accessed once in a loop. So you create an alternative node to check the condition when your Check box is to be checked or empty ( may be based on some field data in the work area). Then you call the necessary graphic ( Checked check box or a empty check box ). A Graphic node is to be created under the alternative node. Do remember to place the graphic in appropriate Line and Cell in your table by giving proper output options.
    Hope this helps you.
    Best Regards, Murugesh AS

  • Why my check box in template show out is rhombus?

    Hi~~
    I want use check box in my template, it result is OK .
    But it shows rhombus, not standard style 「check box」.
    Is font problem?
    I want 「check box」style , not rhombus .
    How can I do ?
    Emily, Thanks

    This check box is picked up from Wingdings font style,
    thsi font is not shipped with XMLP product.
    Alternatively
    you can map it in the Oracle Apps
    through the configuration or have property in Template
    In Template
    Go File ..... Property and Custom tag
    you'll see the property setting required for the check box.
    name: rtf-checkbox-glyph
    type : Text
    value : fontname;9746;9746
    value syntax is like
    fontname;
    <unicode font number for true value’s glyph>;
    <unicode font number for false value’s glyph>
    Use this,
    http://www.alanwood.net/demos/wingdings.html
    Visit this link , check for the character representation for 9745, 9746 in unicode is
    and the one i have said above, is Check box , check & unchecked characters.
    It should work.
    in Wingdings
    for sample "Wingdings;0168;0254"
    168 represents ¨     168
    254 represents þ     254
    This will come in the report.
    Or else same property can b set in Apps level
    in the configuration page, check for administration
    general
    RTF Templates ==> Characters used for checkbox
    set the value , as i said .
    One thing , i was not able to find is
    documentation says
    use this
    "Albany WT J;9746;9745".
    i found link
    http://www.alanwood.net/demos/wgl4.html#w2500
    Using special characters from Windows Glyph List 4 (WGL4) in HTML
    i was not able to find the character for the corresponding number.
    will investigate further.

  • Check Box in Excel sheet

    Hi,
             Please tell me one thing .
    Is there a way dowload ALV report into excel one of the field is check box, check box also downloaded into excel.
    thanks in advance

    Hi ,
    refer this link
    [https://wiki.sdn.sap.com/wiki/display/Snippets/ALV%2bGrid%2bDisplay%2bwith%2bcheckbox%2bto%2bprocess%2bselected%2brecords%2bat%2bruntime]
    Please let me know if you still need any more help.
    Thanks and regards,
    Rajeshwar

Maybe you are looking for

  • Session time-out and password security

    Hi, I have a webservice utility, deployed on several platforms (as an EAR on weblogic and webspere, as a WAR on tomcat), they all exhibit the same feature: on first connection, a username/password box pops up, but after the session times out (after 2

  • IPhone 5S: does anybody has this problem. During a successful voice call all of a sudden people can't hear me while I can hear them

    iPhone 5S: does anybody has this problem. During a successful voice call all of a sudden people can't hear me while I can hear them. Signal is strong and call quality (me hearing the other) is still very good but it looks as if I'm going on mute whil

  • Upgrading Photoshop and getting onto new laptop

    I have Photoshop CS4 Student Edition on my current laptop and it came with 2 copies (you could put it on 2 computers), but I've had to put both my copies on the laptop because I upgrade my OS at one point from Vista to Windows 7 and the first copy go

  • IPod won't update photos-error code 208

    I am having trouble updating my iPod with my photos. It will update my music, but will not transfer any photos. I have uninsalled and reinstalled iTunes, reset and rebooted the iPod, and ensured that my settings to transfer photos are correct: synchr

  • Stock Transport Order- Confirm Quantites

    Is there a way to confirm/reserve quantites in a STO with an availiblity check?  i want to be able to confirm/ reserve quantities so that they are not availible in SD i.e. sales orders.  With an availiblity check in SD, if there are only 5 of x mater