Listview (1 Viewer)

jscontreras

New member
Local time
Today, 18:26
Joined
Jun 11, 2001
Messages
5
Hi All, I have a quick question. I have a listview control that only returns 30 records. Everything is OK except for only getting 30 records. Thanks Here's the code:
Dim db As Database, rs As Recordset
Dim intI As Integer, intTotalRecords As Integer
Dim colHeader As ColumnHeader
Dim lstItem As ListItem
Dim SQL As String
Set db = CurrentDb
'Set rs = db.OpenRecordset("Customers")
SQL = "SELECT [LastName] & ' ' & [firstName] AS FullName, TblVolunteer.City, " & _
"TblVolunteer.Telephone, TblVolunteer.Inactive FROM TblVolunteer"

Set rs = db.OpenRecordset(SQL, dbOpenDynaset)
'Me.Caption = "Volunteer Rolodex as of " & Format(Date, "Long Date")

Me!ListView1.SmallIcons = ImageList1.Object
Me!ListView1.View = lvwReport

' Set up column headers
With ListView1.ColumnHeaders
.Add , , "Volunteer Name", 2880
.Add , , "City", 1440
.Add , , "Telephone", 1000
.Add , , "Inactive", 1000
End With

' Add items and subitems to list control.
rs.MoveFirst
While Not rs.EOF
Set lstItem = ListView1.ListItems.Add()
lstItem.text = rs!FullName
lstItem.SubItems(1) = rs!City
lstItem.SubItems(2) = rs!Telephone
lstItem.SubItems(3) = rs!Inactive
rs.MoveNext
Wend
rs.Close
 

AccessUser

Registered User.
Local time
Today, 18:26
Joined
Mar 28, 2001
Messages
35
list view? Do you mean a list box? Because if you mean a list box, you can just create your query as the row source in the properties and this code will not be necessary.
 

jscontreras

New member
Local time
Today, 18:26
Joined
Jun 11, 2001
Messages
5
This is a listview which is an activeX control.

Thanks
 

pdx_man

Just trying to help
Local time
Today, 10:26
Joined
Jan 23, 2001
Messages
1,347
I created the image control and listview control, used your code and entered in 35 records and all were returned ...

You might want to create a test form and try it again. There might be something extraneous causing your problem.
 

Users who are viewing this thread

Top Bottom