Append Query Error

Leopard011

New member
Local time
Yesterday, 18:03
Joined
Jan 14, 2012
Messages
9
Dear All,

I've a problem with my Append Query, each time I run it, it keeps duplicating entries, the confirmation message tells me that I'm going to add 1 row, this is OK

the second time to run >> 2 rows
3rd one >> 4 rows , 16 , 32 and so on
and each time i run it it keeps doubles the count of rows to be appended
now its telling me that i'm adding 599 rows :mad: do you believe it ??


the SQL code for the append query is this:

INSERT INTO Materials_in_Details ( M_In_No, M_Code, M_Name, M_In_Q )
SELECT [Forms]![Materials_In_Main]![M_In_No] AS Expr1, [Forms]![Materials_In_Main]![Q_M_Code] AS Expr2, [Forms]![Materials_In_Main]![M_In_N] AS Expr3, [Forms]![Materials_In_Main]![M_In_Q] AS Expr4
FROM Materials_in_Details;
 
Sure; you're selecting from the same table you're inserting to. Without a WHERE clause, it will select all records in the table. If you want a single record from the form, either add a criteria or switch to a VALUES clause:

INSERT INTO Materials_in_Details ( M_In_No, M_Code, M_Name, M_In_Q )
VALUES([Forms]![Materials_In_Main]![M_In_No], ...)
 
Thanks sooooooo much
 
By the way, Is there any way to hide the access message which appears after each append action ? I mean to make access add silently without all these messages ?
 
Options include using CurrentDb.Execute instead of RunSQL and DoCmd.SetWarnings (if you go that way, make sure to turn them back on.
 

Users who are viewing this thread

Back
Top Bottom