|
-
Jan 17th, 2000, 06:31 AM
#1
Thread Starter
Hyperactive Member
i am using this code in my program qand it keeps giving me the following error :
" Key is not unique in collection "
i know it is unique all of my keys are i checked them over and over ....
ListView1.ListItems.Add , "d", depname
ListView1.ListItems.Add , "n", coursename
ListView1.ListItems.Add , "c", credits
ListView1.ListItems.Add , "t", coursedes
------------------
- regards -
- razzaj -
-
Jan 17th, 2000, 07:04 AM
#2
Hyperactive Member
Hi, razzaj.
Try this code:
Dim clmX As ColumnHeader
Dim itmX As ListItem
Dim i As Integer
For i = 1 To 4
Set clmX = ListView1.ColumnHeaders.Add()
clmX.Text = "Col" & i
Next i
Set itmX = ListView1.ListItems.Add(, "d", "depname")
Set itmX = ListView1.ListItems.Add(, "n", "coursename")
Set itmX = ListView1.ListItems.Add(, "c", "credits")
Set itmX = ListView1.ListItems.Add(, "t", "coursedes")
Larisa
-
Jan 17th, 2000, 04:43 PM
#3
Thread Starter
Hyperactive Member
i tried that before , same error ... i dont understand ...
-
Jan 18th, 2000, 07:54 AM
#4
Hyperactive Member
This code doesn't give me any error messages. Sorry, I have no idea what can be wrong. I got this error once when I've tried to fill listview with records from db, but I've solved it. But if you are using the same code, then I don't know. Sorry couldn't help you.
Larisa
-
Jan 18th, 2000, 08:23 AM
#5
Member
put ListView1.ListItems.Clear before adding ListItems.
Joon
-
Jan 18th, 2000, 08:49 AM
#6
Thread Starter
Hyperactive Member
thanx guys but i found out how to do it , it turned out to be like in vc++ ( more or less) here :
dim itmX as listitem
Set itmX = ListView1.ListItems.add(, , depname)
itmX.SubItems(1) = coursename
itmX.SubItems(2) = credits
itmX.SubItems(3) = coursedes
------------------
- regards -
- razzaj -
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
|