Results 1 to 6 of 6

Thread: check box

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Manchester
    Posts
    446

    Exclamation

    I have a list of customers i would like to enable if ans when needed. When checked i would like the string to return who i have selected.. can anyone tell me the best option to use in VB.?

  2. #2
    Fanatic Member Wen Lie's Avatar
    Join Date
    Jul 1999
    Location
    Singapore
    Posts
    524

    Cool

    Hi there gsc1ugs,

    What do you want ??? The code or the logic ???
    Both the logic and code, you should specify more I think. Because, I only got this from your msg,...

    You got a list, let's say like this :
    • Customer I
    • Customer II
    • Customer III
    • Customer IV


    and then you have a checkbox like this...
    Enable List ???

    if user check the checkbox, then, the list of customer will enabled. If user uncheck the checkbox, the list of customer will disabled.

    If user check the checkbox, and then choose Customer II, then there will be message / string to show that you choose customer II.

    Am I right ???

    If so, let me know ASAP

    Cheers ,
    Wen Lie

    [Edited by Wen Lie on 06-19-2000 at 06:51 AM]
    Regards,
    [-w-]

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Manchester
    Posts
    446

    Wink check boxes

    Thats the ticket..!

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Manchester
    Posts
    446

    Exclamation check boxes

    hOW DO YOU DO THIS.. DO YOU HAVE AN EXAMPLE

  5. #5
    Fanatic Member Wen Lie's Avatar
    Join Date
    Jul 1999
    Location
    Singapore
    Posts
    524

    Wink Well then, try this

    In a form at design time, place the listbox and checkbox.
    Let's say that the listbox name is lstBox, and the checkbox name is chkBox.

    First, at form load, add your list name of customer.
    Code:
    Private Sub Form_Load()
         For iLoop = 1 to MaxLst
            lstBox.AddItem your item goes here
         Next iLoop
         lstBox.Enable = False
    End Sub
    Then at chkBox_Click Event, write this code :
    Code:
    Private Sub chkBox_Click()
         If chkBox.Value = 1 Then
              lstBox.Enable = True
         Else
              lstBox.Enable = False
         End If
    End Sub
    Then at lstBox_Click Event, write your msg :
    Code:
    Private Sub lstBox_Click()
         Dim Msg
    
         'cek the index of lstBox clicked item.
         'then write :
    
         Msg = lstBox.List(lstBox.ListIndex)     
    End Sub
    Hope will help you...
    And hope will not get any error, coz I make this in sleepy eyes...

    BRgds,
    Wen Lie
    Regards,
    [-w-]

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Manchester
    Posts
    446

    Angry check boxes

    This does'nt really answer my dilema.. i read from a database (i should have told you this) and if the customer read from the database is equal to the check box then do something,, thats my scenario..?

    Many thanks

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