Closing form Inserts Duplicate Entry

feets

Registered User.
Local time
Today, 04:24
Joined
Jan 4, 2007
Messages
12
I am being very stupid here, but I can't figure it out, so maybe you can.

I have an Access ADP form, the source is a SQL View. When you click a command button it runs a stored procedure which inserts the fields into the SQL view. A SQL 'instead of Insert' trigger then inserts the parameter values into the correct table.

Now up to here works great. However when I close the form either through a command button or by clicking the cross, it then proceeds to run another insert, creating a duplicate record.

I've tried closing the ADODB.connection, setting the ADODB.command to nothing, it still inserts the duplicate record.

Any suggestions, much appreciated.
 
Um, could you be using a bound form? If the form is bound, then it adds the data automatically and no SQL execution is necessary.
 

Users who are viewing this thread

Back
Top Bottom