Results 1 to 9 of 9
  1. #1
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398

    copy a table into the BE database

    I've just split my DB. Within my existing code in a form, I have a copyobject statement to copy a table. How do I make sure the new table is copied into the BE DB? I think in the copyobject statement I need to code the destinationdatabase. How do I determine the location of the BE DB from within the FE DB?



    Also, If I need the table hidden in the BE DB, how do I code that?

    Thanks in advance!!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    What is purpose of this table? Why does it need to be in the backend? Is this a regular event? Why?

    Example from my db:

    strExtract = "filepath\database.accdb"
    CurrentDb.Execute "SELECT * INTO Bituminous IN '" & strExtract & "' FROM ConstructionBIT;"
    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. #3
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    It is an archived table. When a new spreadsheet is imported into a table, I'm needing to create an archived table of the previous import.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Did my example help? It will create a new table, not insert records into existing table.
    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. #5
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    VERY COOL!!

    Two more questions, once it's within the BE DB, I need to hide the table, and do I need to link the table to the FE DB's?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Link if you want to view the table from the front end. I have done that programmatically. Example:
    'set table link
    Dim tdf As TableDef
    Set tdf = CurrentDb.CreateTableDef(Me.tbxTestNum)
    tdf.SourceTableName = Me.tbxTestNum
    tdf.Connect = "; DATABASE=" & "filepath\BE.accdb"
    CurrentDb.TableDefs.Append tdf


    For hiding try:
    Application.SetHiddenAttribute acTable, "MyTable", True ' will hide the table "MyTable"
    Application.SetHiddenAttribute acTable, "MyTable", False ' will unhide the table "MyTable"
    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.

  7. #7
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    Thanks, I've been a big help!!

  8. #8
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664


    So has June!!!

    Now that is funny!! Thank you.. I needed a chuckle

  9. #9
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    Quote Originally Posted by ssanfu View Post


    So has June!!!

    Now that is funny!! Thank you.. I needed a chuckle
    Sorry about that. You can tell where my head is right now!!

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

Similar Threads

  1. Copy part of database from table
    By samirmehta19 in forum Import/Export Data
    Replies: 1
    Last Post: 09-06-2013, 01:10 PM
  2. Move or Copy a table to another database
    By Harley Guy in forum Access
    Replies: 7
    Last Post: 11-08-2010, 11:49 PM
  3. Replies: 4
    Last Post: 08-12-2010, 08:38 AM
  4. Copy one table to another database
    By ashthebear in forum Access
    Replies: 2
    Last Post: 06-15-2010, 08:46 AM
  5. Making a backup copy of table or database
    By wasim_sono in forum Access
    Replies: 0
    Last Post: 03-09-2006, 05:44 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