>I've created a form in VFP5 through which I would like to be able to add new records to a given table in my database. I've put a "New Record" button on the form and filled in the 'click' event as follows:
>
>(Sparing the details on steps 1&2)
>1. Disable all buttons and fields not needed during edit
>2. Enable all buttons and fields that are needed during edit
>3. BEGIN TRANSACTION
>4. APPEND BLANK
>
>At this point I get an error message that says that the "Trigger Failed". It is my understanding that data entered within a transaction does not actually get written back to the database until an 'END TRANSACTION' is encountered and therefore should not call any of the triggers until that point.
>
>Can anyone help me out with the reason behind this error? Any help would be greatly appreciated.
>
>Thanks,
>Dan Christensen
Is the table you are adding records to bufered? I also tend to look at transactions as a series of SQL --
Insert Into MyTable (field list) values (field values)etc...
Come to think of it, I have not used an
append blank in my VFP apps for a couple of years now. The problem with append blank is mainly a conflict with primary keys. Your PK has great potential to return an error because the newly appended record has no PK as may another record in the table.
Mark McCasland
Midlothian, TX USA