Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    sergran is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    115
    Hello, thank you for the code .. the problem, and that in this way I export the entire table in another database while I serve it to be exported only one record in another table and that the table or the database using the ID name that identifies the record

  2. #17
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    What I posted is an example, adapt it to your situation. My code exports queries, not tables. If you want a limited set of records to be exported, then build the query to retrieve them. Could probably even be a subquery in the SELECT INTO statement, something like:

    CurrentDb.Execute "SELECT * INTO tablename IN '" & strExtract & "' FROM (SELECT * FROM tablename WHERE fieldname='something') As Query1;"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #18
    sergran is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    115
    Hello, I'm sorry but I can not understand how I use your suggestion

    CurrentDb.Execute "SELECT * INTO tablename IN '" & strExtract & "' FROM (SELECT * FROM tablename WHERE fieldname = 'something') As Query1;"

    I tried to put it in a sql query as a code but does not work. Could you kindly send me a sample mdb?
    Thanks and sorry

  4. #19
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I don't have a sample database and the working db that my code is from is far too complex and large and I am not going to build one just for this thread.

    The example provided post 15 is adequate to follow in writing code for your situation. If you don't know VBA well enough, then the first requirement is to learn VBA.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #20
    stmoong is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Location
    Singapore
    Posts
    108
    Ok, maybe this may not answer your question directly.

    Instead of writing records to another database each time there is a change, you could consider writing a simple vb script and create copies of the database files (probably date or time stamp) and set it to run as a scheduled task.

    The script needs to check if the database file is in use or not. You could set it to run when no one is in office, for example, during midnight or lunch time (just make sure the user disconnect).

    If the application is critical and downtime is a concern, then you should consider migrating it to other databases like MS SQL or Oracle that have more advanced backup facilities (e.g. mirroring, etc).

    If you are still going ahead to implement the way you proposed (i.e. updating records into another database), then, you need to take care of transactions, otherwise, you might end up having the two databases that are not synchonized.

    I hoped I did not misunderstand what you were trying to do.

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

Similar Threads

  1. Automatic backup
    By timpepu in forum Access
    Replies: 4
    Last Post: 08-14-2012, 01:38 PM
  2. backup from my data
    By smahdih in forum Access
    Replies: 3
    Last Post: 11-06-2011, 12:03 AM
  3. Can't backup Db
    By wislndixie in forum Access
    Replies: 1
    Last Post: 08-19-2011, 01:36 PM
  4. Backup of forms
    By torunsu in forum Access
    Replies: 1
    Last Post: 08-08-2011, 08:38 AM
  5. Ezy BackUp
    By FogLine in forum Programming
    Replies: 0
    Last Post: 07-04-2010, 06:46 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