I have a form called allpayments that allows for data entry to a table called CUST_PAYMENTS. On the form I only have certain fields from the table. PAT_ID, TRNSDT, TRNSCD, AMNT. now in SQl I have a trigger called add_to_total2.
The trigger on insert adds the AMNT to the total payment in another table. My issue is when the users enter data into the table. It is being uploaded to the SQl tables via the ODBC connection, but it is not triggering the trigger. So I need to write a code on a command button on the form that will invoke the trigger in SQL to run. any help.
this is the trigger:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFI ER ON
GO
ALTER TRIGGER [dbo].[add_to_total2]
ON [dbo].[CUST_PAYMENT]
AFTER
INSERT
AS UPDATE pat_visit set "Total Payments" = "total payments" + (select amnt from inserted) where
"pat_visit"."Pa tient ID"= (select PATID from inserted)
Can anyone help me?
The trigger on insert adds the AMNT to the total payment in another table. My issue is when the users enter data into the table. It is being uploaded to the SQl tables via the ODBC connection, but it is not triggering the trigger. So I need to write a code on a command button on the form that will invoke the trigger in SQL to run. any help.
this is the trigger:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFI ER ON
GO
ALTER TRIGGER [dbo].[add_to_total2]
ON [dbo].[CUST_PAYMENT]
AFTER
INSERT
AS UPDATE pat_visit set "Total Payments" = "total payments" + (select amnt from inserted) where
"pat_visit"."Pa tient ID"= (select PATID from inserted)
Can anyone help me?
Comment