Set new Record in a form

Hi, can anybody tell me, how I can set the new active Record in a Form after the old one has been modified? I have a form in that not every Record can been changed and I want to set the Cursor to the next possible Record after it has left the old one. I’ve tried this, but it doesnt run correctly: OnAfterValidate() REPEAT xRec.NEXT; UNTIL xRec.Artikelnr <> ‘’; Thanks for help! Bye Michael

Hi Michael, try it with rec instead of xrec. this should do the work. (not tested!) Regards, Frank

No, this didnt work. In my version it does, what it should, but I’m always asked “Wollen Sie den Datensatz umbenennen?” ja/nein (Do you wanna rename this record? yes/no). If I klick on no, the right record is selected and the changes are overtaken, but if this message always appears, it makes working impossible. Maybe me is helped, if somebody can tell me, what this message means. By the way: Now I’ve played my form totally broken. If I press Return at any field, it doesnt effect anything if the field wasnt changed. So I can only go around with the arrow- buttons. This happens even, if I remove the above showed code. Has anybody an idea? Bye Michael

Hi Michael, i have tried it with a simple form with sourcetable “Sales Line” and a tablebox on it. In the OnAfterValidate-Trigger of the Textbox “Description” i use the following code: Currform.update(TRUE); repeat until (xrec.next = 0) or (xrec.description <> ‘’); IF xrec.“Document no.” <> ‘’ THEN get(xrec.“Document type”, xrec.“Document no.”, xrec.“Line No.”); and this works fine. In the GET(…) you have to use the primary key fields of your table. Greetings, Frank

That works fine, thanks a lot. Now I can have a calm evening [:)] Bye Michael