473,385 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Copy one column to another???

This is driving me crazy!! I'm using MSACCESS, and all I want to do is
create a macro/query/anything that will take the data in Column A and
copy it into Column B (same table)

"Insert into" ALMOST works ... unfortunately it adds the data at the
END of Column B ... and I need Column B to be an exact replica of
Column A (but with a different name of course).

Right now I have my users doing it manually, but I really want to
automate it so they don't have to do ANYTHING (i.e. so they don't
break anything).

I've even tried various SendKeys actions ... but there simply isn't
any "select column" command, so I either select a single field, or I
select all the records in the table.

I'm at wit's end ... help??
Nov 13 '05 #1
3 40643
Melissa, Design a query and make it an Update Query. To do that select
Query / Update Query from the main menu while in query design. Add the
field that you want to update to the query grid. In the Update To row set
it to the name of the field in your table that you want it to update from.
If you had Field2 and wanted to update it to Field1 put [Field1] in the
Update to row under Field2. Run the query. Everything in Field1 will be
copied over to Field2 of the same record.

--
Reggie

----------
"Melissa Kay Beeline" <me***************@hotmail.com> wrote in message
news:83**************************@posting.google.c om...
This is driving me crazy!! I'm using MSACCESS, and all I want to do is
create a macro/query/anything that will take the data in Column A and
copy it into Column B (same table)

"Insert into" ALMOST works ... unfortunately it adds the data at the
END of Column B ... and I need Column B to be an exact replica of
Column A (but with a different name of course).

Right now I have my users doing it manually, but I really want to
automate it so they don't have to do ANYTHING (i.e. so they don't
break anything).

I've even tried various SendKeys actions ... but there simply isn't
any "select column" command, so I either select a single field, or I
select all the records in the table.

I'm at wit's end ... help??

Nov 13 '05 #2
You need to build what is called a update query (update is a good
name..eh?).

Depending on your skill level, you can either execute this query in code, or
simply use the query builder.
the sql to do this looks like:
update tableCustomers set Fieldb = fielda

The above can be written as one line of code.

For learning, and getting a feel for the above idea...try ding the above
with the query builder.

from the query tab in the database, you can go:

new->design view->

now, drop in your table.

then go

query->update query

now, in the first column of the grid..simply select fieldb

in the field update to, simply put fiielda..

You can now whack the run button (!).

However, this is DANGEROUS..so MAKE sure you do a back, or test/play on a
copy lest you make a mess here.....

This is a hot knife through butter..and these update sql commands are
powerful....

Good luck..and if you need help on how to do the above in code, or with a
button on a form...feel free to expand on your question...
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.attcanada.net/~kallal.msn
Nov 13 '05 #3
me***************@hotmail.com (Melissa Kay Beeline) wrote:
This is driving me crazy!! I'm using MSACCESS, and all I want to do is
create a macro/query/anything that will take the data in Column A and
copy it into Column B (same table)


I'm curious as to why you would want to do this. Will you be subsequently
changing the copied values?
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bill | last post by:
I have a column of digits I'd like to copy into another column in the same table. How would I do this? Thanks, Bill
0
by: Nicholai Yu | last post by:
Hi everyone I know only some about .net and C# but nothing about Windows API and Shells and etc. So if this is not possible please tell me. I want to copy a text from another process (from IE...
10
by: Steve Bostedor | last post by:
Does anyone have an example of how to file.copy as another user? Do I create a new thread as another user? How is that done? Thanks!
1
by: jvorselaars | last post by:
Does anybody how I can copy several fields into the clipboard. I have copied the code of the following microsoft website: http://support.microsoft.com/support/kb/articles/q210/2/13.asp But...
4
by: Idit | last post by:
Hi, I am running C# application with MFC. dll project. I managed to run the application when the VS2005 environment exists but when I copy the .exe and dll to another computer I get the following...
2
by: TonyJ | last post by:
Hello! I use System.IO.File.Copy(exeFileServer,exeFileLocal); and this exeFileServer is located on another computer node in the network I want to catch the error by using try...catch if this...
5
by: krishhhna | last post by:
hi this is krishhhna, plzz tell me how to copy one column data into another column ,the both columns are in the same table..what is the query
4
by: JDVOIGT | last post by:
I am building a P&L on worksheet(1) based on data from worksheet(2). I need to copy rows of data from worksheet(2) and paste onto worksheet(1). The pasting process needs to find a named range (one...
2
by: Deven Oza | last post by:
Hi, Does anyone have an idea that how to copy column(s) from one excel sheet to another sheet using sql server. Thanks for your help in advance. -Deven
5
Fspinelli
by: Fspinelli | last post by:
I need to keep copies of deleted records. Say there is a contact/record the end user no longer needs from our Contact database. He wants a button to delete the record. Our compliance officer...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.