Results 1 to 7 of 7
  1. #1
    d1dodo is offline Novice
    Windows 10 Access 2003
    Join Date
    Apr 2018
    Posts
    6

    Red face urgently in need

    guys i have 2 data base first one is named database1 and the other one is database2 there is one tables in each data table1 and table2 ( with same proprieties )


    i need the code which is allow to me insert new record in the first table and also add same data in the table2 in database2 in same moment

  2. #2
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    486
    You want to do this in two different databases, or two different tables?

    If two different database you could just import the table from database 2 as a linked table, then run an append query after you add a new record in the table in database 1.

  3. #3
    d1dodo is offline Novice
    Windows 10 Access 2003
    Join Date
    Apr 2018
    Posts
    6
    Quote Originally Posted by tagteam View Post
    You want to do this in two different databases, or two different tables?

    If two different database you could just import the table from database 2 as a linked table, then run an append query after you add a new record in the table in database 1.



    in tow different database but i need to do this in same moment not using append query if i do this by using a query i need to run this query after adding a new data
    the only way i can do this by using VBA code i am trying to use (do.cmd insertinto ) how can i link after this or how can i write after this the code which is allow to me update in same time in the other table in database2

    did you got it ?

  4. #4
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    486
    The append query can be written in VBA to run right after the first insert and will take less than a second, what are you doing in an access database than needs less than a second?

    Anyway, I don't know the VBA very well so I will let another user respond to that part of the question.

  5. #5
    d1dodo is offline Novice
    Windows 10 Access 2003
    Join Date
    Apr 2018
    Posts
    6
    thnx bro it`s a good idea by the way and i will try to use it
    but also i need also to learn how can i write command make me open another database after that open table and set new record in this table so i will see what the other guys will write

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Not sure if or why you missed the point - just link to the table in db2. Run two queries from the same db1, one right after the other. What could be easier?
    There's no need to "open" db2; at least, not that I can see. Why can't you use an append query?
    not using append query
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    i need also to learn how can i write command make me open another database after that open table and set new record in this table
    there are several different ways to write to another database whether by sql or a recordset, and the database doesn't really need to be opened.

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

Similar Threads

  1. Records Disappearing - Urgently need help
    By msmithtlh in forum Access
    Replies: 11
    Last Post: 04-02-2014, 02:37 PM
  2. Replies: 15
    Last Post: 12-28-2011, 05:47 PM

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