473,403 Members | 2,323 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.

Access append query...

How ccan append last entry form one table to another????
Jun 21 '07 #1
4 1850
tdw
206 100+
How ccan append last entry form one table to another????
Create an append query. If you are trying to copy the record from Table1 to Table2, the SQL will look something like this:
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO Table2
  2. SELECT Table1.*
  3. FROM Table1
  4. WHERE ((([Forms]![Formname]![Fieldname])=[Table1]![Fieldname]));
  5.  
Then if you want to delete the record from Table1 after copying it to Table2, create a delete query, which would like something like this:
Expand|Select|Wrap|Line Numbers
  1. DELETE Table1.*
  2. FROM Table1
  3. WHERE ((([Forms]![Formname]![Fieldname])=[Table1]![Fieldname]));
  4.  
Jun 21 '07 #2
Create an append query. If you are trying to copy the record from Table1 to Table2, the SQL will look something like this:
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO Table2
  2. SELECT Table1.*
  3. FROM Table1
  4. WHERE ((([Forms]![Formname]![Fieldname])=[Table1]![Fieldname]));
  5.  
Then if you want to delete the record from Table1 after copying it to Table2, create a delete query, which would like something like this:
Expand|Select|Wrap|Line Numbers
  1. DELETE Table1.*
  2. FROM Table1
  3. WHERE ((([Forms]![Formname]![Fieldname])=[Table1]![Fieldname]));
  4.  

I tried what you have suggested and it create a new col. in the query. Maybe I was not clear in my quest for an answer to my question. Let me try again:
I have two tables, Table1 and Table2. Table1 has 5 fields out of which 2 fields I want to copy from table2. Here is my delima. when I enter new record into tablel I need to pick the 2 new fileds and append table1 by insurting these two fileds in a new record in table1.
Awaiting your advice....
Thanks,
Jun 21 '07 #3
tdw
206 100+
I tried what you have suggested and it create a new col. in the query. Maybe I was not clear in my quest for an answer to my question. Let me try again:
I have two tables, Table1 and Table2. Table1 has 5 fields out of which 2 fields I want to copy from table2. Here is my delima. when I enter new record into tablel I need to pick the 2 new fileds and append table1 by insurting these two fileds in a new record in table1.
Awaiting your advice....
Thanks,
Yes, that is a little different than I was thinking. Unfortunately I don't quite understand exactly what you are trying to do. Maybe the answer to the following questions will help:

1. Are you entering data from a form, and what table is the form's control source?
2. How are you entering data into the other table? What is it's purpose?

Go ahead and give me specific table and field names so we can avoid using confusing nicknames for your fields.
Jun 21 '07 #4
I tried what you have suggested and it create a new col. in the query. Maybe I was not clear in my quest for an answer to my question. Let me try again:
I have two tables, Table1 and Table2. Table1 has 5 fields out of which 2 fields I want to copy from table2. Here is my delima. when I enter new record into tablel I need to pick the 2 new fileds and append table1 by insurting these two fileds in a new record in table1.
Awaiting your advice....
Thanks,
If I'm understanding this correctly, it appears that you want to update certain fields in a table instead of adding a series of records to a table. If so, you must run an "Update" query. Here is a generic SQL statement illustrating this.

UPDATE Table1
INNER JOIN Table2
ON Table1.[JOIN KEY] = Table2.[JOIN KEY]
SET
Table1.[FIELD 4] = [Table2]![FIELD 1],
Table1.[FIELD 5] = [Table2]![FIELD 2];

Hope this helps...
Jun 22 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Fred | last post by:
Hi. How do I import while mapping an excel table to an access table please??? I've searched around and all I can find is a software product or code that does the same thing as the access...
2
by: SenseForAll | last post by:
First please note I am a novice at VBA and not even that experienced with DAO/ADO and MS-SQL. Any assistance is appreciated. That said... I have an application written in Access w/ VBA. I need to...
6
by: Jarrod | last post by:
I have multiple reports in one database, on one form. I need to know what reports were run when, and by Network User ID. How do I do that?
4
by: Shahzad | last post by:
dear respected gurus, I would like to knew how to apply append,insert query for a self table where no primary keys issues. i do have problem say there are 5 rows of single record, this is data...
3
by: Andy Davis | last post by:
I have set up a mail merge document in Word 2003 which gets its data from my Access 2000 database. I want to set up a button on a form that: 1. runs the query to provide the dat for the merge...
4
by: cameron | last post by:
I have always been under the impression that LDAP was optimized for speed. Fast queries, fast access, slower writes. I have a block of data in LDAP and in SQL. Exact same data. The query is fast...
1
by: jjjoic | last post by:
Hi, I use Access 2003 to generate the back-end data for a ColdFusion report at work. The report is sorted by a column and based on the sorting, rankings are assigned to each row(i.e. the biggest...
3
by: hikosj | last post by:
Hi all, I have a problem with a query in access that I cant seem to figure out. I have a form named frmRecruitment with a subform named sfrmParticipant. At the moment I am using an append query to...
13
by: magickarle | last post by:
Hi, I got a pass-through query (that takes about 15 mins to process) I would like to integrate variables to it. IE: something simple: Select EmplID from empl_Lst where empl_lst.timestamp between...
0
by: csin | last post by:
I have an Access DB backend for the application I am running, I want to use the built in ability in Access to remove duplicate entries... Say I have table1 with fields field1 field2 and field3,...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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.