I have A simple form to add records to a table. The table has A trigger for Insert. The Trigger inserts A record in a log table. After each record I add I get this error message
The record source for the is either A tablename or A "Select Tablename.* from Tablename". If I requery the for the data shows up.
When I look in profiler I see these lines
Now 25 is the PK value of the record in the log table. It seems that access is looking for @@IDENTITY the PK of the Log Table not SCOPE_IDENTITY( ) the PK of the main table
Any Ideas
Thanks In Advance
MsAccess Error Messege Box said:The data was added to the database but the data won’t be displayed in the form because it doesn’t satisfy the criteria in the underlying record source.
The record source for the is either A tablename or A "Select Tablename.* from Tablename". If I requery the for the data shows up.
When I look in profiler I see these lines
The next line isSQL Profiler said:SELECT @@IDENTITY
SQL Profiler said:exec sp_executesql N'SELECT * FROM ( SELECT * FROM "dbo"."Tablename" ) AS DRVD_TBL WHERE "FieldName" = @P1', N'@P1 int', 25
Now 25 is the PK value of the record in the log table. It seems that access is looking for @@IDENTITY the PK of the Log Table not SCOPE_IDENTITY( ) the PK of the main table
Any Ideas
Thanks In Advance