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

    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
    1,583
    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 online now Competent Performer
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Location
    CT and VT
    Posts
    203
    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 online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    2,075
    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 Very idle programmer
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    4,595
    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 (Mendip Data Systems) : Website, email
    If this has helped, please click the star button and leave a comment
    Asking for help isn't giving up. Its refusing to give up.

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 - Senior Forums