Results 1 to 6 of 6

Thread: [RESOLVED] stop items duplicating

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2006
    Posts
    18

    Resolved [RESOLVED] stop items duplicating

    I have a project due for college tomorrow,its an IT job finder project..so far I've coded the command buttons,textboxes,checkboxes etc,so anything the user inputs on form1 will be printed off on form 2...

    Im stuck on the listbox and combo box ......I have 1 combobox which displays three jobtypes ...Permanent,Full time and Part time,once the user clicks on any of these a listbox with 5 jobtitles should appear in the listbox to the right of the combo box....

    VB Code:
    1. Private Sub Cbojobtype_Click()
    2. If Cbojobtype.Text = "Full Time" Then
    3. lstjobtitle1.AddItem "IT Manager"
    4. lstjobtitle1.AddItem "IT Sales Executive"
    5. lstjobtitle1.AddItem "IT Field Technican"
    6. lstjobtitle1.AddItem "IT Procedure Director"
    7. lstjobtitle1.AddItem "IT Director"
    8.  
    9. ElseIf Cbojobtype.Text = "Contract" Then
    10. lstjobtitle1.AddItem "IT Auditor"
    11. lstjobtitle1.AddItem "IT Project Manager"
    12. lstjobtitle1.AddItem "Operations & IT Coordinator"
    13. lstjobtitle1.AddItem "Service & Support Manager"
    14. lstjobtitle1.AddItem "Senior Engineering Manager"
    15.  
    16.  
    17. ElseIf Cbojobtype.Text = "Part Time" Then
    18. lstjobtitle1.AddItem "Ecommerce consultant"
    19. lstjobtitle1.AddItem "Network Engineer"
    20. lstjobtitle1.AddItem "Programmer"
    21. lstjobtitle1.AddItem "Test Analyst"
    22. lstjobtitle1.AddItem "QA Manager"
    23.  
    24. End If
    25. End Sub
    26.  
    27. Private Sub Form_Load()
    28. Cbojobtype.AddItem "Contract"
    29. Cbojobtype.AddItem "Full time"
    30. Cbojobtype.AddItem "Part Time"
    31. End Sub


    my problem is that when i click on say Contract for example....the 5 jobtitles appear fine in the listbox..but if i click contract again..the items for contract duplicate ...so I end up with

    IT Auditor
    IT Project Manager
    Operations & IT Coordinator
    Service & Support Manager
    Senior Engineering Manager
    IT Auditor
    IT Project Manager
    Operations & IT Coordinator
    Service & Support Manager
    Senior Engineering Manager

    items repeat over and over again........

    so my question would be how would i stop these items duplicating?...and how would i go about clearing a listbox when i switch over to another jobtype..like permanent...because contract jobtitles remain when i switch...

    (ps)ive only been using VB6 for about 3 weeks now,so I apologise for my lack of knowledge...

    thanks for anyones input.
    Last edited by MartinLiss; Oct 8th, 2006 at 01:04 PM.

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