OnAftergetRecord->inserting or modifying 2nd tab

Brad_SetzerBrad_Setzer Member Posts: 12
I have an employee table and a second employee table because the first was full. I have an employee card that uses subforms that give access to this 2nd employee table.

On opening the Employee Card for, let's say, employee BUR100, I want to run a quick check for the existence of record BUR100 in employee table 2. If not present, it must be inserted.

How can I manage this without the annoying 'you cannot make any changes to the table from this trigger' error ???

Thanks.

Brad

Answers

  • Brad_SetzerBrad_Setzer Member Posts: 12
    Found it. Added a check to the onmodify-trigger of the 2nd table:

    IF NOT Rec.GET("No.") THEN
    Rec.INSERT(TRUE);
  • DenSterDenSter Member Posts: 8,307
    I would put that in the OnInsert trigger of the first table. That way, every time you insert a record in the 1st table, a record will also be inserted in the second table. To catch up on existing records, I would write a processing only report to create the records in the second table.
Sign In or Register to comment.