473,804 Members | 2,201 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 40870
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.goo gle.com...
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
68346
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
1231
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 for instance). Instead of letting user press Ctrl+C, I want my program to do it as an agent (The fundanmental solution to tablet pc apps. When the user use guesture on my app, it will do the copying.) Is there anyway that I can invoke the API to...
10
3649
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
2621
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 with this code i can only copy 1 string each time into the clipboard. I would like to copy more text fields, so for example I can paste it in excel and the fields will fill a (part) of a column. Thanks
4
2422
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 errer: An unhandled exception of type 'System.IO.FileNotFoundException' occurred in FilesUpdateApplication.exe Additional information: Could not load file or assembly 'StrtData, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of...
2
1648
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 node is not accessible for some reason. It might be down or something else How is this done?
5
16092
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
4029
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 cell) on worksheet(1) and insert a row for the copied data above the named cell. In addition, each row on worksheet(2) must first be identified by a cell value in row (d) and be pasted to a corresponding named cell. Source = Worksheet(2) ...
2
3540
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
2541
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 wants us to keep a copy of that deleted record in another table. What's the best method to do this? I would like a method going on behind the scenes of one button the end user clicks to delete the record. Thank you so much for your help! Faith
0
10600
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10352
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7642
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5535
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3835
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.