Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: Combo Boxes Limited to 65536 (64 KB) Rows


View products that this article applies to.

This article was previously published under Q207601
Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

For a Microsoft Access 97 and earlier version of this article, see 187342 (http://support.microsoft.com/kb/187342/EN-US/ ) .

↑ Back to the top


Symptoms

When you view the list portion of a combo box or a list box that is based on a table, a query, a view, or a stored procedure with more than 65,536 records, you only see the first 65,536 rows.

↑ Back to the top


Cause

Microsoft Access limits the number of rows displayed in a combo box or a list box to 65,536 rows.

↑ Back to the top


Resolution

Use a query, a view, or a stored procedure to restrict the number of rows that the combo box or the list box is displaying to no more than 65,536.

↑ Back to the top


More information

Steps to Reproduce Behavior

  1. Open the sample database Northwind.mdb.
  2. Create a module and type the following line in the Declarations section if it is not already there:
    Option Explicit
    					
  3. Type the following procedure:
    Sub FillTable()
       ' Creates a table that contains
       ' 70,000 records.
    
       Dim db As DAO.Database
       Dim tbl As DAO.TableDef
       Dim fld As DAO.Field
       Dim rs As DAO.Recordset
       Dim lng As Long
    
       Set db = CurrentDb
       Set tbl = db.CreateTableDef()
       tbl.Name = "LargeTable"
       Set fld = tbl.CreateField("Field1", dbLong)
       tbl.Fields.Append fld
       db.TableDefs.Append tbl
       Set rs = tbl.OpenRecordset(dbOpenDynaset)
       For lng = 1 To 70000
          rs.AddNew
          rs.Fields("Field1") = lng
          rs.Update
       Next
       rs.Close
       MsgBox "Table Created"
    End Sub
    					
  4. To run this procedure, type the following line in the Immediate window, and then press ENTER:
    FillTable
    When the procedure is finished, you receive a message indicating that the table was created.
  5. Open a new form in Design view, and add a combo box to the form.
  6. Set the RowSource property of the combo box to LargeTable.
  7. Open the form in Form view.
  8. Type 65536 in the combo box.
  9. Click the arrow next to the combo box to view the list. Note that 65536 is the last visible row in the combo box.

↑ Back to the top


Keywords: KB207601, kbprb

↑ Back to the top

Article Info
Article ID : 207601
Revision : 2
Created on : 6/24/2004
Published on : 6/24/2004
Exists online : False
Views : 335