Results 1 to 4 of 4
  1. #1
    mlrucci is offline Competent Performer
    Windows 7 64bit Office 365
    Join Date
    Apr 2018
    Posts
    202

    Run Time error 6 Overflow

    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

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,411
    First thing I would try:

    Dim ListRows as Long

  3. #3
    mlrucci is offline Competent Performer
    Windows 7 64bit Office 365
    Join Date
    Apr 2018
    Posts
    202
    Worked like a charm. Can you explain why?

  4. #4
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,411
    Quote Originally Posted by mlrucci View Post
    Worked like a charm. Can you explain why?
    The maximum value of the integer type is 32767, while long is 2,147,483,647.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Error: overflow.
    By Homegrownandy in forum Programming
    Replies: 6
    Last Post: 05-02-2019, 02:47 AM
  2. overflow error
    By emir in forum Access
    Replies: 5
    Last Post: 11-23-2015, 07:47 AM
  3. Replies: 1
    Last Post: 11-13-2014, 02:54 PM
  4. OverFlow Error.
    By Coffee in forum Import/Export Data
    Replies: 5
    Last Post: 08-17-2011, 05:44 PM
  5. Run time error '6': Overflow
    By wasim_sono in forum Access
    Replies: 0
    Last Post: 06-22-2007, 06:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums