Results 1 to 10 of 10
  1. #1
    George F is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    4

    Ho to create a copy and paste macro


    I want to create a copy / paste macro in acces 2016 to copy one one field to another field with in the same table

    THanks.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    In a macro,
    to copy db objects: COPYOBJECT.

    if you mean copy data, build an APPEND QUERY.
    inside the append query , is a select query to copy the source.

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    not enough info to provide an informed response. here are some links

    https://bytes.com/topic/access/answe...te-macro-event
    https://stackoverflow.com/questions/...-in-access-vba

  4. #4
    George F is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    4
    I create a table with 2 fields.1 field contain Initials and the other field Last Names.I combined the info together on a form and want to copy it and past it back in to the same table ,but into another field

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    there is no need to store the data twice, just use a query to combine them when required e.g. something like

    SELECT initials & " " & LastName as FullName
    FROM myTable

    the normal practice is to keep the fields separate as you have them at the moment - it makes it easier and quicker to find records when searching on last name

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Ajax is quite correct. Combining fields and performing calculations should be done only in queries/reports/forms - not tables. (At least about 99.5% of the time when it comes to calculations).
    Imagine the difficulty you will have when "A Smith" marries Mr. Brown and she changes her last name to Brown.
    Last edited by Micron; 02-14-2018 at 09:26 PM. Reason: clarification
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    George F is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    4
    Quote Originally Posted by Micron View Post
    Ajax is quite correct. Combining fields and performing calculations should be done only in queries/reports/forms - not tables. (At least about 99.5% of the time when it comes to calculations).
    Imagine the difficulty you will have when "A Smith" marries Mr. Brown and she changes her last name to Brown.
    Hi Ajax.
    i did combine the 2 fields as you mention.
    The reason why I am doing this is because I index the combine field with no duplications.in the properties.
    Tx

  8. #8
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    I index the combine field with no duplications.in the properties.
    for this situation, you use a multi field index and set it to no duplicates allowed - see the index option on the ribbon when in table design view.

  9. #9
    George F is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    4
    Thank you for your assistance ,I cot it right to create a copy and paste macro.

  10. #10
    sanal is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Feb 2018
    Posts
    43
    Copy data from excel sheet and paste it in the rows of a spreadsheet subform via VBA is posible

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

Similar Threads

  1. Macro to copy and paste
    By chr1stoper1 in forum Macros
    Replies: 2
    Last Post: 04-11-2016, 06:51 AM
  2. Replies: 1
    Last Post: 01-21-2015, 11:33 PM
  3. Replies: 1
    Last Post: 11-25-2014, 01:42 PM
  4. Replies: 3
    Last Post: 04-07-2012, 09:01 AM
  5. Replies: 2
    Last Post: 06-06-2011, 04:18 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