Results 1 to 13 of 13
  1. #1
    cjbuechler is offline Novice
    Windows Vista Access 2000
    Join Date
    May 2009
    Posts
    25

    Combo box returning only about 1000 records

    I have a form with a combo box that only returns about 1000 records from the table it references. As we add new records to the table the ones at the end no longer show in the combo box until we get the total number back down.

    Question: Is this a limitation of combo boxes (I had never seen it before) or something else?

    The combo box's rowsource is obtained through the following code:

    Private Sub Form_Load()
    On Error GoTo Err_Form_Load
    Dim rs As ADODB.Recordset
    Dim sSQL As String
    Dim sInLocation As String
    Dim varTemp As Variant

    'get data the user has rights to
    LocationID.RowSource = "SELECT tblLocations.LocationID, tblLocations.LocName " _
    & "FROM tblLocations INNER JOIN tblEmployeeLocations ON " _
    & "tblLocations.LocationID = tblEmployeeLocations.LocationID " _
    & "WHERE tblEmployeeLocations.EmployeeID = " & gsUserEmpID
    cboIndividual.RowSource = "SELECT DISTINCT tblIndividual.IndividualID, " _
    & "ISNULL(tblIndividual.LastName, '') " _
    & "+ ', ' + ISNULL(tblIndividual.FirstName, '') " _
    & "+ ' ' + ISNULL(tblIndividual.MiddleName, '') AS FullName " _


    & "FROM tblEmployeeLocations INNER JOIN tblLocations ON " _
    & "tblEmployeeLocations.LocationID = tblLocations.LocationID INNER JOIN " _
    & "tblEmployees ON tblEmployeeLocations.EmployeeID = tblEmployees.EmployeeID " _
    & "RIGHT OUTER JOIN tblIndividual ON tblLocations.LocationID = tblIndividual.LocationID " _
    & "WHERE tblEmployees.User_Name = '" & gsUserName & "' " _
    & "ORDER BY ISNULL(tblIndividual.LastName, '') " _
    & "+ ', ' + ISNULL(tblIndividual.FirstName, '') " _
    & "+ ' ' + ISNULL(tblIndividual.MiddleName, ''), " _
    & "tblIndividual.IndividualID"

    sSQL = "SELECT LOCATIONID FROM tblEmployeeLocations " _
    & "WHERE EMPLOYEEID = " & gsUserEmpID

  2. #2
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Check Options->Edit/Find, you might see a limit. (See attached for an example)

    Why would you want your user to search through a combo box with that many items?

  3. #3
    cjbuechler is offline Novice
    Windows Vista Access 2000
    Join Date
    May 2009
    Posts
    25
    Thanks Jzwp11, I was hopefull but it looks like that didn't change the limit in that list.

    If I run the select statement in a SQL query it shows all records. Looks like it's only with Combo Boxes that I get that problem.

    It's a list of contact records built by an old designer. I'm open to suggestions on a better way.

  4. #4
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Doing some research, there is mention of people who have tens of thousands of records showing in a combo box. I could not find a specific limit for combo boxes on the Microsoft site. You show the query constructed in code but you only said that you tried the SELECT statement. There is a WHERE clause in the code that would restrict records did you include that?

  5. #5
    cjbuechler is offline Novice
    Windows Vista Access 2000
    Join Date
    May 2009
    Posts
    25
    Thank you, I appreciate your help.

    It also occurs to me that I should have mentioned the record set is from a linked SQL table.

  6. #6
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Looking more closely at the code you provided, it is restricting the combo box.

    This portion of the code, finds the location of the user but it does not appear to be referenced directly on the code that provides the data to the other combo box
    Code:
    'get data the user has rights to
    LocationID.RowSource = "SELECT tblLocations.LocationID, tblLocations.LocName " _
    & "FROM tblLocations INNER JOIN tblEmployeeLocations ON " _
    & "tblLocations.LocationID = tblEmployeeLocations.LocationID " _
    & "WHERE tblEmployeeLocations.EmployeeID = " & gsUserEmpID
    The following portion of the code provides the row source to the cboIndividual combo box which I assume is the one that is limited but it doesn't use the location combo box above, but filters based on the user again (see red highlighted area). I'm also not sure about the right join (shown in blue); that may also be causing some records to be ignored but it is hard to say without a better understanding of your table structure.

    Code:
    cboIndividual.RowSource = "SELECT DISTINCT tblIndividual.IndividualID, " _
    & "ISNULL(tblIndividual.LastName, '') " _
    & "+ ', ' + ISNULL(tblIndividual.FirstName, '') " _
    & "+ ' ' + ISNULL(tblIndividual.MiddleName, '') AS FullName " _
    & "FROM tblEmployeeLocations INNER JOIN tblLocations ON " _
    & "tblEmployeeLocations.LocationID = tblLocations.LocationID INNER JOIN " _
    & "tblEmployees ON tblEmployeeLocations.EmployeeID = tblEmployees.EmployeeID " _
    & "RIGHT OUTER JOIN tblIndividual ON tblLocations.LocationID = tblIndividual.LocationID " _
    & "WHERE tblEmployees.User_Name = '" & gsUserName & "' " _
    & "ORDER BY ISNULL(tblIndividual.LastName, '') " _
    & "+ ', ' + ISNULL(tblIndividual.FirstName, '') " _
    & "+ ' ' + ISNULL(tblIndividual.MiddleName, ''), " _
    & "tblIndividual.IndividualID"

  7. #7
    cjbuechler is offline Novice
    Windows Vista Access 2000
    Join Date
    May 2009
    Posts
    25
    Sorry, the LocationID.Rowsource is for another combo box used in another tab on this form and isn't related the the cboindividual one. Sorry, my fault for including that in the thread info.

    My first thought was that something was wrong with the select but I dropped the select statement for cboindividual into a query analyzer and it displayed all the expected rows. The joins work fine otherwise and taking them out still produces the problem. It's always the last people in the list that don't display...We always know we have more than 1000 records when we start losing the Z's in the drop down.

  8. #8
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    I'm at a loss relative to the Access side; I'm not familiar with SQL Server enough to know if you can restrict that way. Sorry that I could not be of more help.

  9. #9
    cjbuechler is offline Novice
    Windows Vista Access 2000
    Join Date
    May 2009
    Posts
    25
    Thanks though. I appreciate you taking a look at it.


    The SQL seems fine from all my testing but the Access front end seems to be the issue. I'm thinking the original designer programatically set a limit on the box but I have now idea where.

  10. #10
    cjbuechler is offline Novice
    Windows Vista Access 2000
    Join Date
    May 2009
    Posts
    25
    Figured it out and I need to appologize for incorrect info....the total records were 10000 not 1000.

    Jzwp11, thanks for your help. You lead me to the options screen and on the Advanced tab there is a max records limit set. It was set to 10000. Once increased it allowed all the records to show.

  11. #11
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    I'm glad you got it worked out! Best of luck on your project.

  12. #12
    alexk_doxa is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2010
    Posts
    1
    Jzwp11, I would like also to thank you very much for your help!!!
    I did a LOT of searching before find your solution. God bless you!

  13. #13
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Glad we could help out, and welcome to the forum!

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

Similar Threads

  1. Replies: 1
    Last Post: 05-18-2010, 11:43 AM
  2. Document 1000,s Access DBs automatically
    By Blaise in forum Access
    Replies: 3
    Last Post: 05-18-2010, 11:30 AM
  3. Error 1000
    By Hinkhig in forum Access
    Replies: 4
    Last Post: 10-01-2009, 08:12 AM
  4. Replies: 0
    Last Post: 08-04-2009, 09:14 AM
  5. Recalling Records from a Combo search
    By Dreamcatcher in forum Forms
    Replies: 0
    Last Post: 08-18-2008, 07:33 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