Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ListView - Adding items. Should be dead simple but I'm stumped 2

Status
Not open for further replies.

TudorSmith

Programmer
Jan 14, 2002
245
0
0
GB
Hi All

I have a ListView field withthe following properties:
View = lvwReport

I have opened a recordset, and I'm trying to insert the two values of each record into two columns on this poxy listview field like this:
Code:
' Declared in a public module
Code:
Public itm As ListItem

Set itm = lvwTotals.ListItems.Add(, , rs!pmwostatus_code)
itm.SubItems(1) = rs!PMWO

It's falling over on the second entery. I get an error message saying: "INVALID PROPERTY VALUE"

Am I missing somethign in the properties of the listview box? Or do I need to declare anything else in my code?

Thanks

Tudor




birklea ~©¿©~ <><
Dim objJedi as Jedi.Knight
Set objJedi[skyWalker].Aniken = FatherOf(useThe.Force(objJedi[skyWalker].luke))
 
Set itm = lvwTotals.ListItems.Add(,SetIncrementingKeyValueHere , rs!pmwostatus_code)

egs &quot;Key&quot; & i
 
Have you added two columns to your listview?

Andy
&quot;Logic is invincible because in order to combat logic it is necessary to use logic.&quot; -- Pierre Boutroux
&quot;A computer program does what you tell it to do, not what you want it to do.&quot; -- Greer's Third Law
 
Easy peezey...lemon squeezy....

Thanks keys...have a star

Tudor


birklea ~©¿©~ <><
Dim objJedi as Jedi.Knight
Set objJedi[skyWalker].Aniken = FatherOf(useThe.Force(objJedi[skyWalker].luke))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top