Data entry from an access form to the CUST_PAYMENT table is not hitting my SQL trigge

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bherring
    New Member
    • May 2010
    • 6

    Data entry from an access form to the CUST_PAYMENT table is not hitting my SQL trigge

    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?
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Is this trigger firing via a manual insert in a Query Window?

    ~~ CK

    Comment

    • bherring
      New Member
      • May 2010
      • 6

      #3
      trigger will not fire when data inserted in access but does fire when data entered into SQl table

      Comment

      • ck9663
        Recognized Expert Specialist
        • Jun 2007
        • 2878

        #4
        How are you inserting the record in access? Could you post the T-SQL here?

        ~~ CK

        Comment

        Working...