Results 1 to 5 of 5
  1. #1
    10 Gauge's Avatar
    10 Gauge is offline Getting the hang of it...
    Windows 7 64bit Access 2007
    Join Date
    Feb 2011
    Location
    Fredericksburg, VA
    Posts
    202

    Copy contents of one field to another

    I am wondering if this is possible.

    I would like to have a button next to a field on my form which when pressed will copy the contents of the field to a different field on the same form/record and set the originating field back to null.

    I would also like the field being copied in to to not have any previous data erased and overwritten. I'd just like the data to be added to whats already there.



    I am designing a Miss Utility ticket tracking database which needs to be updated frequently, each job gets assigned a new ticket number every time it's updated and I want to store all of the old ticket numbers in a memo field just for reference and safekeeping.

    Can something like this be done? TIA.

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    yes. Assuming your data is in txt1 and you want to add it to txt2; then on that command button you would put:

    me.txt2 = me.txt2 & " , " & me.txt1

    have put in a comma between which you can leave out if you want to:


    me.txt2 = me.txt2 & me.txt1

    then below that just put
    me.txt1 = ""

    to blank that field

    hope this helps.

  3. #3
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    correct and neat

  4. #4
    10 Gauge's Avatar
    10 Gauge is offline Getting the hang of it...
    Windows 7 64bit Access 2007
    Join Date
    Feb 2011
    Location
    Fredericksburg, VA
    Posts
    202
    Quote Originally Posted by NTC View Post
    yes. Assuming your data is in txt1 and you want to add it to txt2; then on that command button you would put:

    me.txt2 = me.txt2 & " , " & me.txt1

    have put in a comma between which you can leave out if you want to:


    me.txt2 = me.txt2 & me.txt1

    then below that just put
    me.txt1 = ""

    to blank that field

    hope this helps.
    Thank you NTC! Do I just create a new module for this code? I'm sorry I'm just new to all of this but tryind to trudge my way through it and get this project done.

  5. #5
    10 Gauge's Avatar
    10 Gauge is offline Getting the hang of it...
    Windows 7 64bit Access 2007
    Join Date
    Feb 2011
    Location
    Fredericksburg, VA
    Posts
    202
    I got it.

    Thanks again NTC that's absolutely great!

    Instead of a comma, is there a way to add a line break since the data is being input in to a rich text memo box?

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

Similar Threads

  1. Select contents of a field on click?
    By anoob in forum Access
    Replies: 7
    Last Post: 03-01-2011, 07:59 AM
  2. Copy Contents
    By SPKO in forum Forms
    Replies: 4
    Last Post: 11-03-2010, 10:26 AM
  3. Use VBA to copy table contents to the clipboard?
    By Deutz in forum Programming
    Replies: 3
    Last Post: 10-21-2010, 10:59 PM
  4. VBA to update field contents...Error 91
    By jpkeller55 in forum Access
    Replies: 9
    Last Post: 10-11-2010, 07:52 PM
  5. Remove contents from each field
    By nancyszn in forum Access
    Replies: 7
    Last Post: 08-06-2009, 03:41 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