Save records

woeterwoeter Member Posts: 11
hello,

My form contains fields from 2 tables (Customer and File).
My form is linked to Customer (sourcetable). I want to add a new record with fields from File. If I try with:

recField.RESET;
CLEAR(recField);
recField.INSERT;
recField.ID:=100;
recOuder.Function:='DD';
recOuder.modify;
COMMIT;

Won't work!!

what to do?

Comments

  • krikikriki Member, Moderator Posts: 9,118
    Check
    http://www.mibuso.com/forum/viewtopic.php?t=9441

    Some comments on your code:
    CLEAR(recField); // RESET is not needed. CLEAR includes RESET;
    recField.ID:=100;  // you might also use VALIDATE in case there is some code behind the field that must be executed
    recOuder.Function:='DD';  // you might also use VALIDATE in case there is some code behind the field that must be executed
    recField.INSERT(TRUE);
    
    No need to do an insert and then a modify. In this case only insert is needed. Best is always to use INSERT(TRUE) except when you're you don't want it.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.