473,770 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

copy a column from table to table in access VB

I'm trying to import specific columns from an excel file
(Requirements.x ls) into an access table (tblRequirement s). Using VBA,
I'm able to import the entire excel file into table
(tblImportRequi rements). Instead of going row by row of
(tblImportRequi rements) and copying the fields needs to
(tblRequirement s) it would be faster to just copy the column and over
write the other table's column. I'm not sure how to copy a few
columns from (tblImportRequi rements) to (tblRequirement s) using VBA.
Any suggestions? Is this even possible?

Feb 15 '07 #1
5 5193
How about linking the Excel spreadsheet and then using an update query on the
specific field? This assumes that there is a way to relate the Access table
and the Excel spreadsheet (via a key field or a combination of fields).

Ho******@gmail. com wrote:
>I'm trying to import specific columns from an excel file
(Requirements. xls) into an access table (tblRequirement s). Using VBA,
I'm able to import the entire excel file into table
(tblImportRequ irements). Instead of going row by row of
(tblImportRequ irements) and copying the fields needs to
(tblRequiremen ts) it would be faster to just copy the column and over
write the other table's column. I'm not sure how to copy a few
columns from (tblImportRequi rements) to (tblRequirement s) using VBA.
Any suggestions? Is this even possible?
--
Message posted via http://www.accessmonster.com

Feb 15 '07 #2
On Feb 15, 9:39 am, "kingston via AccessMonster.c om" <u27511@uwe>
wrote:
How about linking the Excel spreadsheet and then using an update query on the
specific field? This assumes that there is a way to relate the Access table
and the Excel spreadsheet (via a key field or a combination of fields).
That would be a good idea but I use a different excel files each time
I import. What I'm trying to do is link from DOORs to access. Since
DOORs is a proprietary database I use excel as a go between. So I'm
importing a few columns from DOORS via excel and maitianing additional
information in other collumns in the access table.

Feb 15 '07 #3
It's OK to use different Excel files so long as the copy that Access is
linked to has the same name and location every time. In other words, copy
the Excel files to another intermediate file that Access uses. It's not
clear whether you need to access all of the Excel files together. I'm
assuming that you get a refresh every so often and you want the data in that
refresh to replace existing data in Access.
Ho******@gmail. com wrote:
>On Feb 15, 9:39 am, "kingston via AccessMonster.c om" <u27511@uwe>
wrote:
>How about linking the Excel spreadsheet and then using an update query on the
specific field? This assumes that there is a way to relate the Access table
and the Excel spreadsheet (via a key field or a combination of fields).

That would be a good idea but I use a different excel files each time
I import. What I'm trying to do is link from DOORs to access. Since
DOORs is a proprietary database I use excel as a go between. So I'm
importing a few columns from DOORS via excel and maitianing additional
information in other collumns in the access table.
--
Message posted via http://www.accessmonster.com

Feb 15 '07 #4
On Feb 15, 2:23 pm, "kingston via AccessMonster.c om" <u27511@uwe>
wrote:
It's OK to use different Excel files so long as the copy that Access is
linked to has the same name and location every time. In other words, copy
the Excel files to another intermediate file that Access uses. It's not
clear whether you need to access all of the Excel files together. I'm
assuming that you get a refresh every so often and you want the data in that
refresh to replace existing data in Access.
I could make it so the exported excel files are exported to the same
location and have the same name. I would only be periodically syncing
one excel file at a time. What happens if new rows are added to the
excel files, will they automatically be added to the access table?
Feb 16 '07 #5
You would need to use an Append query to add new rows to your table. If
possible, set up a unique key to prevent duplicate records or put date-based
criteria or something similar in the Append query. So in short, you'd run an
Update query to change existing data (selected columns) and an Append query
to add new records from a linked Excel spreadsheet. This can be done in an
autoexec macro so users don't have to intervene unless there is a problem;
then they'd give you a call.
Ho******@gmail. com wrote:
>On Feb 15, 2:23 pm, "kingston via AccessMonster.c om" <u27511@uwe>
wrote:
>It's OK to use different Excel files so long as the copy that Access is
linked to has the same name and location every time. In other words, copy
the Excel files to another intermediate file that Access uses. It's not
clear whether you need to access all of the Excel files together. I'm
assuming that you get a refresh every so often and you want the data in that
refresh to replace existing data in Access.

I could make it so the exported excel files are exported to the same
location and have the same name. I would only be periodically syncing
one excel file at a time. What happens if new rows are added to the
excel files, will they automatically be added to the access table?
--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200702/1

Feb 16 '07 #6

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

Similar topics

3
12184
by: jcwhui | last post by:
Hello all, Yes, it is another Oracle 8.0 question. We are just too small to force our customer to migrate to newer Oracle. My problem is I need to copy the value of the long column in table A to another table B's long column. Unfortunately, "insert into table_a select long_column from table_b" doesn't work. I also thought of changing table_a's long column to clob,
19
3478
by: davidgordon | last post by:
Hi, I need some pointers/help on how to do the following if it possible: In my access db, I have the following: Tables: Products, Sub-Assembly, Product-Pack Table, Products
2
7072
by: C G | last post by:
Dear All, I'm trying to insert an xml file into my database. I have a table with a single text column. My intention is just to have the xml file take up one row in the table. I've tried the command COPY t1 FROM '/tmp/file.xml';
2
3466
by: Robert Fitzpatrick | last post by:
Does COPY require values for each column even though the database field is not set to NOT NULL? I did a COPY TO first to line up the data and then COPY FROM a tab delimited file. Here are the first 5 fields in the first line of the incoming file (omit the quotes, I put them there to see where the start and end of the line is), you should find 3 tabs after the second '1': '1 1 ' I have a table with this structure below and when...
4
17969
by: Kevin Murphy | last post by:
This is a tip for the record in case it helps somebody else in the future. I have an import script that relies on a stored procedure that runs as a trigger on inserts into a temporary table. The script looks like this: -- create table -- ... -- define procedure and trigger
4
8076
by: andrewmac | last post by:
I hope someone can help - I am new to Access so please be patient. I have a list of about 100 equity tickers in a column in Excel formatted as Text. I am trying to copy and paste into a field in a table in Access with Text data type. For some reason Access only wants to paster the first 3 records. Can anyone please help me? Thanks in Advance
10
17943
by: pbd22 | last post by:
Hi. Like the title says - how do i do this? I was given the following example: INSERT INTO TABLE2 SELECT * FROM TABLE1 WHERE COL1 = 'A' The above statement threw the following error:
3
24684
by: Manuel | last post by:
Hi to all, I'm trying to copy a Datacolumn from a table to another, but with this code: destTable.Columns.Add(srcTable.Column); I got this error: Column 'colname' already belongs to another DataTable. Anyone can help me?
2
4431
by: dashingdude | last post by:
I run an Access-based application that uses main1.mdb (updated weekly). However going forward I would only receive main2.mdb file with different structure. My question is how I can copy data from main2.mdb file into main1.mdb. The main1.mdb had 5 tables and main2.mdb has 9 tables (5 tables similar to ones in main1.mdb + 4 new tables). The good news is that I don’t need to use the data from 4 new tables. However few columns have been renamed or...
0
9618
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10260
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
10101
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...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7456
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
6712
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
5354
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...
1
4007
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
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.