Listview control problem in Access 2000

K

Kurt60

I am trying to use a listview control on an Access 2000 form and populate if
from a recordset using VBA. The problem is that the listitem is not available
for the listview control. I added the listview control using the references
under tools in VB. I've tried changing the view property on the control but
the listitem still does not appear when I type "listview.". If I type
"listview.l" left is the first selection that appears. Can anyone tell me
what the problem is?

Thanks,

Kurt
 
K

Kurt60

Sorry, No its actually lvwDES. When I type the . other properties and methods
are listed but not the listitem. I'm wondering if I'm using an older version
or possibly the control properties are not set correctly.
 
D

Douglas J. Steele

Does it work when you type it, even if you don't get the intellisense?

To be honest, I'm not sure that you will get intellisense to work properly
with the listview control.
 
K

Kurt60

I'm thinking that may be the case. I copied the code to load the control and
I may have assumed incorrectly that the problem was with the control when it
may be a problem with the way I am trying to populate it. Here is the way I
am trying to load the control.



Dim mItem As ListItem
Do Until rsd.EOF
Set mItem = lvwDes.ListItem.Add()

rsd of course is a recordset object, when the set statement executes a
runtime error 438 is returned with the message "object does not support this
object property of method" which makes me think that there is a problem with
the control. I added the listview control from references under tools and put
the Mscomctl.ocx in the winnt\system32 folder. Do I need to register this
from the command line?

Thanks,

Kurt
 
D

Douglas J. Steele

Yes, mscomctl.ocx needs to be registered.

And it should be:

Set mItem = lvwDes.ListItems.Add()

You're adding a ListItem object to the ListItems collection.
 
K

Kurt60

Thanks Doug, I overlooked the 's', that seems to have made the difference. I
appreciate your patience and help.

Kurt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top