Results 1 to 6 of 6

Thread: How to make all checkbox to true **RESOLVED**

  1. #1

    Thread Starter
    Addicted Member thiru_rajamani's Avatar
    Join Date
    Aug 2004
    Location
    Chennai,India
    Posts
    214

    Resolved How to make all checkbox to true **RESOLVED**

    Hi I have a listbox with checkboxes, there are "n" number of check boxes, I want to make them checked (true) when I am loading the form? how to do?
    Last edited by thiru_rajamani; Feb 2nd, 2005 at 01:20 PM.
    Thanks
    Raj

  2. #2
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    Re: How to make all checkbox to true

    You might try this:

    Dim MyControl As Control
    For Each MyControl In me.Controls
    If TypeOf MyControl Is CheckboxBox Then MyControl.value = vbchecked
    Next MyControl

  3. #3
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: How to make all checkbox to true

    Checkbox controls or checked items in a listbox?


    Has someone helped you? Then you can Rate their helpful post.

  4. #4

    Thread Starter
    Addicted Member thiru_rajamani's Avatar
    Join Date
    Aug 2004
    Location
    Chennai,India
    Posts
    214

    Re: How to make all checkbox to true

    I have a listbox

    lstbom.ListStyle =fmListStyleOption

    On loading of form, all the check boxes i the list box are unchecked (false),
    but I want them as checked (true)
    Thanks
    Raj

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How to make all checkbox to true

    VB Code:
    1. Dim i As Long
    2. For i = 0 To List1.ListCount - 1
    3.     List1.Selected(i) = True
    4. Next

  6. #6

    Thread Starter
    Addicted Member thiru_rajamani's Avatar
    Join Date
    Aug 2004
    Location
    Chennai,India
    Posts
    214

    Re: How to make all checkbox to true

    Thank you hack . works nice
    Thanks
    Raj

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width