|
-
Oct 8th, 2006, 12:39 PM
#1
Thread Starter
Junior Member
[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:
Private Sub Cbojobtype_Click()
If Cbojobtype.Text = "Full Time" Then
lstjobtitle1.AddItem "IT Manager"
lstjobtitle1.AddItem "IT Sales Executive"
lstjobtitle1.AddItem "IT Field Technican"
lstjobtitle1.AddItem "IT Procedure Director"
lstjobtitle1.AddItem "IT Director"
ElseIf Cbojobtype.Text = "Contract" Then
lstjobtitle1.AddItem "IT Auditor"
lstjobtitle1.AddItem "IT Project Manager"
lstjobtitle1.AddItem "Operations & IT Coordinator"
lstjobtitle1.AddItem "Service & Support Manager"
lstjobtitle1.AddItem "Senior Engineering Manager"
ElseIf Cbojobtype.Text = "Part Time" Then
lstjobtitle1.AddItem "Ecommerce consultant"
lstjobtitle1.AddItem "Network Engineer"
lstjobtitle1.AddItem "Programmer"
lstjobtitle1.AddItem "Test Analyst"
lstjobtitle1.AddItem "QA Manager"
End If
End Sub
Private Sub Form_Load()
Cbojobtype.AddItem "Contract"
Cbojobtype.AddItem "Full time"
Cbojobtype.AddItem "Part Time"
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|