473,403 Members | 2,359 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,403 software developers and data experts.

Transfer data from one table to another

Using vba it is easy to transfer a single record from one table to
another, where the two tables have the same structure. But its long
winded when there are, say, 100 fields. So is there a clever bit of
code that can achieve this without rs2![Field38] = rs1![Field38] and so
on.......?

Thanks
Dave

Jan 23 '06 #1
4 2263
On 23 Jan 2006 01:18:11 -0800, "Dave G @ K2" <da**@k2computers.co.uk> wrote:
Using vba it is easy to transfer a single record from one table to
another, where the two tables have the same structure. But its long
winded when there are, say, 100 fields. So is there a clever bit of
code that can achieve this without rs2![Field38] = rs1![Field38] and so
on.......?

Thanks
Dave


INSERT INTO tblTable1
SELECT *
FROM tblTable2;

Wayne Gillespie
Gosford NSW Australia
Jan 23 '06 #2
Sorry if I'm being thick here - but how does that transfer just one
record? Ah but wait, what if the second line was something like SELECT
* WHERE tblTable2.ID = 86 or whatever. Would that do it?

Jan 23 '06 #3
On 23 Jan 2006 02:09:30 -0800, "Dave G @ K2" <da**@k2computers.co.uk> wrote:
Sorry if I'm being thick here - but how does that transfer just one
record? Ah but wait, what if the second line was something like SELECT
* WHERE tblTable2.ID = 86 or whatever. Would that do it?


Sorry I forgot the where statement -

INSERT INTO tblTable1
SELECT *
FROM tblTable2
WHERE ID=86;
Wayne Gillespie
Gosford NSW Australia
Jan 23 '06 #4
Thanks Wayne. Simple really - I'm embarassed I didn't know this - I
must do a bit more SQL

Cheers Dave

Jan 23 '06 #5

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

Similar topics

6
by: StephenMcC | last post by:
Hi All, Got a quick query in relation to the Server.Transfer method available in IIS 5+/ASP. I've got an issue where I want to take a portion of an online app and extract this out into a web...
1
by: bwalke | last post by:
Hi all, I am fairly new to using triggers and was seeking some help from those that have experience with them. I am looking to transfer data from a SQL 2000 database to a Visual FoxPro database...
2
by: fhadlaq | last post by:
I need a little help here.. I want to transfer ONLY new records AND update any modified records from Oracle into SQL Server using DTS. How should I go about it? a) how do I use global variable...
2
by: David Berman | last post by:
It seems that my site is losing session information when using Server.Transfer. I have a page called PictureGallery.aspx. It takes an argument which is an index id, so it would look like...
4
by: Sparky Arbuckle | last post by:
I want to transfer to a search page from my default page to SearchResults.aspx and I want to pass a variable named strSearch. So far I have: Dim strSearch as string strSearch = tbSearch.text...
2
by: Igor | last post by:
Is there a way to transfer ntext data from one table to another? I tried this UPDATE SET = (SELECT FROM WHERE =1) WHERE = 1;
4
by: Luvin lunch | last post by:
Hi, I've developed a worklist system in Access and I plan to deploy four copies of it to the four users that need it. I said I'll be deploying copies because there is no shared network in the...
5
by: rajaaryan44 | last post by:
how can we transfer data from one access database to another databse . the table name is same for both the database . in one table some records are there (rs say e.g.) now another table has say...
2
by: rajaaryan44 | last post by:
how can we transfer data from one access database to another databse . the table name is same for both the database . in one table some records are there (rs say e.g.) now another table has say rs+10...
7
by: JamesHoward | last post by:
Does anyone know any method to have one program, acting as a server transfer a socket connection to another program? I looked into transferring the connection via xml rpc to no avail. It seems to...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.