Results 1 to 5 of 5

Thread: Combo Box {RESOLVED}

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    262

    Combo Box {RESOLVED}

    I want to set a value to flgElim 0 or 1 depends on which item is selected in the combo box, cmbElim

    VB Code:
    1. Option Explicit
    2. Public flgElim As Boolean
    3.  
    4. Private Sub cmbElim_Change()
    5.  
    6. If cmbElim.ListIndex = "0" Then
    7. flgElim = "0"
    8. ElseIf cmbElim.ListIndex = "1" Then
    9. flgElim = "1"
    10. End If
    11.  
    12.  
    13. End Sub

    This is what I have now and it doesn't work.. I've also tried using cmbElim.Index but I dunno what else to try
    Last edited by ooOOJaVaOOoo; Jun 3rd, 2005 at 02:00 PM.

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

    Re: Combo Box

    Try moving your code from the Change even to the Click event. You aren't selecting anything from the Change event.

  3. #3
    Addicted Member epod69's Avatar
    Join Date
    Feb 2005
    Location
    Cambridge, WI - USA
    Posts
    239

    Re: Combo Box

    since flgElim is declared as a boolean, all you have to do is enter 'flgElim = True' or 'flgElim = False'. You are doing right using the ListIndex but I dont think you need the quotes around it.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    262

    Re: Combo Box

    Thanks for the quick responses! Took both of yer replies and it works

  5. #5
    Addicted Member epod69's Avatar
    Join Date
    Feb 2005
    Location
    Cambridge, WI - USA
    Posts
    239

    Re: Combo Box {RESOLVED}

    heh, np. I was in you position just a few months ago....this is a great community and youll learn so much here and soon you will be helping others out as well =) .

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