Results 1 to 6 of 6

Thread: combo box problem

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    combo box problem

    I use combo box and have 3 items. This combo box follow a sequence.Let say, I choose the activity 2.How I can make the items to the first activity on click event?

    Private Sub Cal1_Click()

    end sub

    this is the first activity "Menebas jerami dengan ‘rotor slasher’. Perlu dilakukan secepat mungkin selepas menuai. Jika lewat batang jerami akan susah dipotong"


    and the last activity is "Memeriksa status kesuburan tanah dengan mengambil sample tanah untuk analisis dan memereksa variasi tanah dengan mengambil bacaan EC untuk dibuat peta variasi"

    Private Sub Form_Load()
    Combo1.AddItem "Menebas jerami dengan ‘rotor slasher’. Perlu dilakukan secepat mungkin selepas menuai. Jika lewat batang jerami akan susah dipotong."
    Combo1.AddItem "Memeriksa pasarana, membina taliair, parit buang dan kotak kawalan bagi setiap lot, jika belum ada."
    Combo1.AddItem "Memeriksa status kesuburan tanah dengan mengambil sample tanah untuk analisis dan memereksa variasi tanah dengan mengambil bacaan EC untuk dibuat peta variasi."
    End Sub

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: combo box problem

    could somebody help me

  3. #3
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: combo box problem

    You could use the ListIndex to identify which item is selected. 0 being the first Item, 2 being the last (in this example).

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: combo box problem

    could you give me a example of using listIndex for combo box

  5. #5
    Fanatic Member
    Join Date
    Sep 2006
    Location
    London, UK
    Posts
    817

    Re: combo box problem

    I not sure if I follow you but is this what you are after?

    VB Code:
    1. Private Sub Combo1_Click()
    2. If Combo1.text= "Menebas jerami dengan ‘rotor slasher’. Perlu dilakukan secepat mungkin selepas menuai. Jika lewat batang jerami akan susah dipotong." Then
    3. 'Add code for what you want done.
    4. end sub

    Can you explain what you are after any better?

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: combo box problem

    Actually, I use calender control and combo box. The item list in the combo box is
    Private Sub Form_Load()
    combo1.additem "activity1"
    combo1.additems " activity2"
    End Sub
    This items will list in the combo box. I just choose the items in the combo box for activity. Let say, I click the date in calender, and choose the items in combo box, let say activity2.So the sstab1 is true and I get the date information for activity2.
    Private Sub Combo1_Click()
    If Combo1.Text = "activity2." Then
    SSTab1.Visible = True
    end if

    The click event for calender is :
    Private Sub Cal1_Click()
    'I want to put the code, that the first activity list is Activity1 in the combo box when I click the calender control
    end sub

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