Results 1 to 5 of 5
  1. #1
    MadTom's Avatar
    MadTom is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Location
    CT and VT
    Posts
    206

    different results in query?

    Why would I get different results in a query after I split my DB?
    After a split I don't list tblParts in my query only tblPartsB* tables.
    I still have to check for other problems, but most seems to work fine.


    Thanks!

    Code:
    SELECT MSysObjects.Name, DCount("*","[" & [Name] & "]") AS RecCountFROM MSysObjects
    WHERE (((MSysObjects.Name) Like "tblPartsB*") or (MSysObjects.Name) Like "tblParts" AND ((MSysObjects.type)=1) AND ((MSysObjects.Flags)=0))
    ORDER BY MSysObjects.Name;

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    I would guess either the flags or object type are therefore different from the criteria supplied?

    What happens if you remove them.
    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 ↓↓

  3. #3
    MadTom's Avatar
    MadTom is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Location
    CT and VT
    Posts
    206
    If I remove them it does work as expected. Don't know why? Thanks!
    All tables are in the BE. and DB not shared, one user.

    One other thing that doesn't seem to work is DoCmd.CopyObject, runs with no errors, but will delete tblParts.
    I can DoCmd.ReName, but can't copy a Linked table

    Code:
     DoCmd.CopyObject , "tblPartsBackup" & Now(), acTable, "tblParts"

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Are you running the query in the front-end? If yes you need to include MSysObjects.type)=6 to include the linked tables:
    https://www.devhut.net/2010/06/12/ms...abase-objects/

    Cheers,
    Vlad
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Type =1 and Flags =0 applies to local tables only.
    Access linked tables have Type =6 and Flags value will probably be 2097152
    See View External Tables - Mendip Data Systems
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

  1. Replies: 6
    Last Post: 08-21-2019, 07:17 AM
  2. Replies: 2
    Last Post: 04-15-2017, 11:09 AM
  3. Replies: 5
    Last Post: 05-21-2013, 02:21 PM
  4. Replies: 3
    Last Post: 05-02-2013, 10:36 AM
  5. Replies: 6
    Last Post: 05-14-2012, 07:24 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