+ Reply to Thread
Results 1 to 4 of 4

Open recordset not returning records

  1. #1
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    331

    Open recordset not returning records

    If I run the following code, I get all the records in my database.

    Please Login or Register  to view this content.
    The above code returns a recordset that includes records with the RID=201907041504102

    If I run the following code it does not return any records for RID=201907041504102.

    Please Login or Register  to view this content.


    Can any provide any guidance into what I may be doing wrong?

    If I change the WHERE RID= to a different RID ...sometimes it returns records sometimes it doesn't.
    Each RID definitely has records in the database.
    FYI... the recordset has RID's with last 3 digits starting from 101 to 110.
    It seems to randomly not return any records eg RID's ending in 102,106,110

  2. #2
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    331

    Re: Open recordset not returning records

    Okay, so turns out that when adding the RID to my new table it randomly adds a 3 digit decimal to random RID's.

    In the original data source (another access table) RID is stored as a Number formatted as Decimal with 3 digits.
    If I get a recordset with the RID=201907041504102 from this table I get the desired result.

    RID is stored as Number formatted as Double in my new table.



    The RID's are added to my new table from the original table like this:

    Please Login or Register  to view this content.

    All of the RID's are ORIGINALLY integers...why would Access add a random 3 digit decimal to random RID's in the process of adding records to my new table?
    Last edited by anrichards22; 07-05-2019 at 11:36 PM.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 2019
    Posts
    15,435

    Re: Open recordset not returning records

    Have you checked your table design to ensure that the formatting of the field is correct.

  4. #4
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    331

    Re: Open recordset not returning records

    Thanks for the reply Alan.

    Changing the data type from decimal to double fixed the problem.

    I am still curious as to why Access would add decimals to a value that is an integer if it is is stored as a decimal. On top of that it seems to add these decimals to random records in the recordset.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1