Good morning, I am running MS access 64 bit. I have a list based on a qry to detect duplicates. I have code that will remove duplicates. For calculation/QC purposes, I want to show the number of rows that are duplicates. When opening the form, I get run-time error 6 overflow. The table has >160,000 records. I have no problems running the code with 90,000 records. My error is on the line of ListRows = .ListCount in the code below. Any ideas?
Code:
Private Sub CountItemsCommand()
Dim lstDups As Control
Set lstDups = Me.lstDups
Dim ListRows As Integer
ListRows = 0
With lstDups
If .ListCount > 0 Then
ListRows = .ListCount
Else
'Exit Sub
End If
End With
Me.txtLstCount = ListRows
Set lstDups = Nothing
End Sub