ListItem has it been replaced

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am working in Access 2003. I have a system that was in Access 2000 or
Access 2002 with a ListItem. I am getting a compile error on the listitem.
Has ListItem been replaced in Access 2003.

Thanks!
Terry
 
I don't believe ListItem was ever a part of Access. The only ListItem I can
think of in context with Access would be if you were using a Listview
control, which requires a reference to either mscomctl.ocx or comctl32.ocx.
 
Private a As Integer, b As Integer
Private objItem As ListItem
'Private colUpdates As Collection
Private mflgIsDirty As Boolean
Private mflgClose As Boolean
Dim Unchecked() As Integer

Private Sub LoadListBox()
Dim objDisplay As UpdateDisplay
ReDim Preserve Unchecked(colUpdates.Count + 1)
lstUpdates.ListItems.Clear
For a = 1 To colUpdates.Count
Set objDisplay = colUpdates.Item(a)
Set objItem = lstUpdates.ListItems.Add(a, , "")
With objItem
If Unchecked(a) = 0 Then
.Checked = True
Else
.Checked = False
End If
.SubItems(1) = objDisplay.Flag
.SubItems(2) = objDisplay.Description
.SubItems(3) = objDisplay.First_Name
.SubItems(4) = objDisplay.Last_Name
.SubItems(5) = objDisplay.Facility_Name
.SubItems(6) = objDisplay.EffectiveDate
.SubItems(7) = objDisplay.Specialty
.SubItems(8) = objDisplay.Address1
'.SubItems(9) = objDisplay.Address2
.SubItems(9) = objDisplay.Contract_Type
'.SubItems(10) = objDisplay.Phone

End With
Set objItem = Nothing
This is the code. The compile error was when the ListItem in the option
Explicit section. It works in Access 2000 at the client site. Please let me
know.

Thanks!
Terry
 
That definitely looks like it's code for a listview control, which is not a
standard part of Access. lstUpdates on your form is almost certainly a
listview control (as opposed to a standard Access listbox).

Open up the Access 2000 database where it works. Open the VB Editor, and
choose Tools | References from the menu bar. I'm pretty sure you'll find a
reference to Microsoft Windows Common Controls (i.e.: it'll be one of the
rows with a check box listed at the top of the references)

The only reason you'd be using that code is if you've got a listview on your
form. When you add the listview, the reference should automatically be made
for you.
 
I'm sorry, what are you looking for?

I've already tried to explain that listviews have never been part of Access,
that you've always had to make a reference to an external control (Microsoft
Windows Common Controls)

To add a listview to your form in Access 2003 is exactly the same as it was
in Access 2000. Click on the "More controls..." icon in the toolbox, scroll
through the list of available controls until you find one that starts
"Microsoft Listview Control", select it, then draw it onto your form when
the dialog closes.

Is there something else you need to know?
 
Back
Top