Results 1 to 7 of 7
  1. #1
    Kelsod is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    12

    Copy data from one column to another in the same table

    I need to copy the data from one column and add it to the existing text in the column next to it in the same table. I'm sure this is a very simple VBA, but I have no idea how to do it. Can someone please help a beginner?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    It is not usual for two fields (columns) in the same record to have the same value. Please tell us more about what you are doing.

  3. #3
    Kelsod is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    12
    Sorry, it made sense in my head Okay so I have an address that has been split into two columns. One column has the house number (e.g., 100, 200, 300, etc.) The next column has the rest of the address (e.g., E. Knight Ave.) I just want one column with the whole address 100 East Knight Ave. 200 East Knight Ave. etc. So I need to take all info in column B to column A with a space after the number so that it can be used in an invoice. Is that more helpful?

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Yes, but you do not need to use up a field (column) for this, you can simply use a query with a calculated (concatenated) value. FullAddress = StreetNumber & " " & StreetName

  5. #5
    Kelsod is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    12
    Is it easier to write all the queries that way or to actually fix the problem. I would just do it manually, but there are 600 entries. I would like it to be a permanent change and then just delete the second column.

  6. #6
    Kelsod is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    12
    I tried this, but it didn't work
    Sub mycode()
    CurrentDb.Execute "INSERT INTO House(HouseID) SELECT House(Address)"
    End Sub

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Quote Originally Posted by Kelsod View Post
    Is it easier to write all the queries that way or to actually fix the problem. I would just do it manually, but there are 600 entries. I would like it to be a permanent change and then just delete the second column.
    I would strongly recommend you leave your fields the way you have them. The one query will work for all records in the table.

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

Similar Threads

  1. Replies: 3
    Last Post: 03-05-2013, 05:14 AM
  2. Replies: 7
    Last Post: 10-15-2012, 11:05 PM
  3. How do I copy all the data from a Column
    By winterh in forum Queries
    Replies: 5
    Last Post: 04-18-2012, 08:13 AM
  4. copy data from one table to another
    By Sureshbabu in forum Access
    Replies: 1
    Last Post: 01-08-2012, 01:27 PM
  5. String to Copy a Field of Data to Another Table
    By aquarius in forum Programming
    Replies: 1
    Last Post: 09-17-2010, 09:02 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