Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Wouldn't life be a whole lot easier if you simply linked to the other table? Anyway, try just selecting from the foreign table and see what happens.
    SELECT * FROM tblBookmarks IN 'S:\DataHome\BidBunker_DATA.accdb';



    If your method worked for Isladogs but not you, it would seem that you have yet to address your version as the culprit. However, you've gone from SELECT * INTO to INSERT INTO, and I cannot recall ever seeing INSERT INTO without specifying the target fields in some way. Not sure if you can use the wildcard for that because I'd take the easy route and link the source tables.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  2. #17
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Hi Micron
    Yes, you can do an INSERT query like that.
    I agree with you completely about linking the source table(s) from the other database.

    @Day4
    The generalised version which I've just tested is:
    Code:
    DoCmd.RunSQL "INSERT INTO newTable SELECT * FROM " & tblName & " IN '" & dbPath & "'"
    or use CurrentDb.Execute

    In either case, it should run without error
    However, do bear in mind that this code will allow you to repeatedly append the same data, so I recommend you empty the destination table first:

    Code:
    CurrentDb.Execute "DELETE * FROM newTable;", dbFailOnError
    CurrentDb.Execute "INSERT INTO newTable SELECT * FROM " & tblName & " IN '" & dbPath & "';", dbFailOnError
    However if you link the source table(s) as recommended above, the IN part of the query is no longer needed.
    Make use of linked tables wherever possible. It makes coding much easier & there are no drawbacks!
    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

  3. #18
    wvmitchell is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2020
    Posts
    24
    Can you inspect the rights on dbPath to determine if anything has changed?

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 05-07-2020, 06:58 AM
  2. Runtime Error 3251 object not supported
    By avanduyvenbode in forum Programming
    Replies: 2
    Last Post: 10-18-2016, 09:54 AM
  3. Audit Trail Code - Error 3251
    By Juans in forum Access
    Replies: 3
    Last Post: 01-04-2015, 02:21 PM
  4. Checkbox OldValue property gives Error 3251
    By Monterey_Manzer in forum Programming
    Replies: 11
    Last Post: 05-06-2014, 03:10 PM
  5. Giving a specific number to some data
    By Knelou in forum Forms
    Replies: 1
    Last Post: 09-12-2013, 08:45 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