Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Brugge, Belgium
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy and past a ms Access Datatable (MS Access 2007)

    Is it posible to copy a ms Access datatable ( structure and content) and paste it in an other ms Access Database using vba Code

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Copy and past a ms Access Datatable (MS Access 2007)

    DoCmd.TransferDatabase can be used to export a table to another Access database, for example:

    DoCmd.TransferDatabase acExport, "Microsoft Access", "C:AccessOtherDatabase.mdb", acTable, "tblSource", "tblTarget"

    Look up TransferDatabase in the Access VBA help for more info.

  3. #3
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Brugge, Belgium
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy and past a ms Access Datatable (MS Access 2007)

    this hint helped me in the wright direction, but executing the proposed command resulted in an error saying "types mismatched"

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Copy and past a ms Access Datatable (MS Access 2007)

    That's because you added a comma after TransferDatabase that shouldn't be there. Please read my previous reply more carefully and look up TransferDatabase in the VBA help.

  5. #5
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Brugge, Belgium
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy and past a ms Access Datatable (MS Access 2007)

    You're wright , as you see more attention is neccesary, but after hours of programming and trying to find the solution, this becomes a very great problem

  6. #6
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Brugge, Belgium
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy and past a ms Access Datatable (MS Access 2007)

    I only can say you're are wright. But after hours of searching to solve the problem, keeping up the attention becomes a greate problem.
    Thank you very much for the hint

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Copy and past a ms Access Datatable (MS Access 2007)

    Please note also that if you remove the comma, the instruction still isn't correct. The next to last argument should be the name of the target table instead of the name of a database.

    DoCmd.TransferDatabase acExport, "Microsoft Access", "d:Nieuwe mapTest.accdb", acTable, "tblContacts", "dntwerpOpvang.accdb", False

    "dntwerpOpvang.accdb" should be replaced with the name of the target table.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •