Results 1 to 2 of 2
  1. #1
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,191

    open another database


    Hi guy's, how do i open another database and add data to a table but have the 2nd database not visible ?

    db1 to open db2 and add data to to a table with the same field names thn close the database from a message box ie:

    rsdb1 = etc etc
    rsdb2 = etc etc
    Do Until rsdb1.EOF
    rsdb2 = rsdb1.Fields etc etc

    If Msgbox("You have sucessfully updated db2, Do You want to view the updates or close db2 ?") = vbNo Then
    DoCmd.cancel
    Else
    close db2
    End IF

    I haven't actually coded this yet but hoping to very shortly

    much appreciated

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    While it is possible to open another database, append or update records then close it, I've never yet heard a good reason for doing so.
    There is a simple alternative readily available to you.
    Link the table(s) that you wish to update.
    Run your append/update query/queries/sql.
    Job done.

    If you really want to do so, you could break the links after the update but why bother?
    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: 2
    Last Post: 11-27-2016, 11:12 PM
  2. Replies: 1
    Last Post: 10-01-2015, 09:14 AM
  3. Replies: 2
    Last Post: 04-25-2014, 11:22 AM
  4. Replies: 10
    Last Post: 01-02-2014, 04:16 PM
  5. Replies: 4
    Last Post: 11-27-2013, 09:51 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