Results 1 to 6 of 6
  1. #1
    WonkyPython is offline Novice
    Windows 10 Office 365
    Join Date
    Oct 2022
    Posts
    4

    Why would my Query contain less records than my Table

    I don't understand how this can happen:

    I have a table of 8449 records with an Auto-number set to the Primary Key.
    I then created a Query with one column...the Primary Key.
    I noticed that there are only 8446 records.
    I have performed a Compact and repair operation.
    How can this happen?

    UPDATE


    I have found that I had previously added a related table to this query and then removed it. That linked table had 3 blank fields.
    After I removed the table from the query I would have expected it to return to the complete number of records, but it didn't.

    Is this a bug or what?

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,938
    No idea.
    Can you upload the db?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    What's the SQL of the query you are using?
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,938
    UPDATE
    I have found that I had previously added a related table to this query and then removed it. That linked table had 3 blank fields.
    After I removed the table from the query I would have expected it to return to the complete number of records, but it didn't.
    DId you save the query?
    If you determined you had a table joined when you opened it, then it would appear you did not?, else the query would look normal but not behave normally.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    Or you're going by the max autonumber value when you say 8449 but 3 an's got tossed.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    WonkyPython is offline Novice
    Windows 10 Office 365
    Join Date
    Oct 2022
    Posts
    4
    Quote Originally Posted by Welshgasman View Post
    No idea.
    Can you upload the db?
    I don't want to upload the db I'm afraid...too much info and not for public scrutiny!

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

Similar Threads

  1. Replies: 3
    Last Post: 10-06-2020, 02:09 AM
  2. Replies: 8
    Last Post: 12-04-2018, 09:49 AM
  3. Replies: 13
    Last Post: 05-10-2017, 12:43 AM
  4. Replies: 21
    Last Post: 03-14-2016, 01:33 PM
  5. Replies: 4
    Last Post: 07-14-2015, 06:49 PM

Tags for this Thread

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