OK - Move HELP! (1 Viewer)

djshongo

Registered User.
Local time
Today, 12:25
Joined
Oct 25, 2005
Messages
34
hiya all! i need some help!

i want to make a button on my "Calls" database form, to move all "Finished" calls (calls that have been declared as completed), into a "Finished Calls" table.
I have half of it working - i have a button that DELETES all 'Finished' calls. However i now need them to COPY into my "Finished Calls" table... is it an Append Query i need?

the code i have now is as follows...

SELECT * INTO Table2
FROM Table1
WHERE Finished='Yes';


thanks in advance!
johnny
 

neileg

AWF VIP
Local time
Today, 12:25
Joined
Dec 4, 2002
Messages
5,975
Yes you need an append query, but remember to append first, then delete, otherwise there will be nothing to append. The alternative is to leave the transactions in the table but filter them out with a query.
 

djshongo

Registered User.
Local time
Today, 12:25
Joined
Oct 25, 2005
Messages
34
Code:
The alternative is to leave the transactions in the table but filter them out with a query.

i tried doing this but i could only get it to COPY the records from one table to the other - it didnt DELETE them from the original table , so i had redundant data..

any ideas how the append query should look..?

thanks
 

djshongo

Registered User.
Local time
Today, 12:25
Joined
Oct 25, 2005
Messages
34
ok this is my code now...

INSERT INTO Table2 ( [Date], Name, [Pastoral Info], Targets, Detention, Finished )
SELECT Table1.Date, Table1.Name, Table1.[Pastoral Info], Table1.Targets, Table1.Detention, Table1.Finished
FROM Table1
WHERE (((Table1.Finished)="Yes"))


DELETE*
FROM Table1
WHERE Finished="Yes";


the first half works, it moves them, but the second part will not work - it doesnt run...how should i fix this?

thanks
 

neileg

AWF VIP
Local time
Today, 12:25
Joined
Dec 4, 2002
Messages
5,975
Try this
Code:
DELETE*
FROM Table1
WHERE Table1.Finished="Yes";
 

Mile-O

Back once again...
Local time
Today, 12:25
Joined
Dec 10, 2002
Messages
11,316
You might want to put a space between DELETE and the asterisk. :)
 

Users who are viewing this thread

Top Bottom