Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    copy and paste by code ? (Access 2000)

    Is it possible to make a code that performs the same actions as copy and paste ? I want if possible to have a code that copies all records from the table
    table2 and pastes them into the identical table2 ?

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: copy and paste by code ? (Access 2000)

    It sounds like you want to run an append query, but perhaps you might explain more.

    Are both tables in the same database? Why do you want each record twice?
    Regards
    John



  3. #3
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: copy and paste by code ? (Access 2000)

    Thank you for your reply.Both tables are in the same database.The table1 is corrupted,but it is a part of a relationship, and i cannot make the relationship with tables filled with data. I am trying to evade this problem,and i am sending this code
    in another town,so the best way will be if i append all the data from the table2 into the blank table2. Can you help me writing the code ?

    regards

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

    Re: copy and paste by code ? (Access 2000)

    You can't have two tables named Table2 in the same database.

    If Table1 is corrupt, but Table2 isn't, why do you want to copy records from Table2 into an empty table? It doesn't make sense to me. However, as John mentioned, you wouldn't need code for that; an append query would do what you want. If your blank table is named BlankCopyOf Table2, the SQL for the query would be

    INSERT INTO BlankCopyOfTable2 SELECT * FROM Table2

Posting Permissions

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