Results 1 to 4 of 4
  1. #1
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    479

    Method to Update table from one db to another


    If I have 2 databases with identical table structures, can I update a record from one to the other without iterating all the fields?
    I think possibly an Update query using INTO but I'm not 100% sure.
    And if yes, but there's only one field to update should I specify it, or do all fields regardless?

  2. #2
    Join Date
    Apr 2017
    Posts
    1,792
    Contain both tables always same data, and the new data are always entered into table in 1st DB?

    When this is the case, then simply link the table in 1st DB into second one?

  3. #3
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    If you don't want to maintain a link to the other table and want to link and unlink on demand you could use code like: (obviously use your own variables/arguments)

    Code:
            DoCmd.TransferDatabase acLink, "Microsoft Access", strFile, acTable, strTargetTable, strTargetTable
    Code:
    Public Sub UnlinkTable(strTableName As String)
    
    
        CurrentDb.TableDefs.Delete (strTableName)
        
    End Sub
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  4. #4
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    479
    Thanks for the suggestions, Am trying them out.

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

Similar Threads

  1. Replies: 3
    Last Post: 07-26-2017, 08:14 AM
  2. update multiple records, best method
    By NikoTheBowHunter in forum Database Design
    Replies: 2
    Last Post: 06-08-2017, 08:59 AM
  3. Replies: 1
    Last Post: 05-11-2015, 11:31 PM
  4. Replies: 6
    Last Post: 08-21-2014, 09:14 AM
  5. Replies: 5
    Last Post: 10-22-2013, 07:37 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