How to set a new active Record in a form

MichaelBullaMichaelBulla Member Posts: 5
edited 2004-05-03 in Navision Attain
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


If I do this 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 to the old one, 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 in the form, 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

Comments

  • RobertMoRobertMo Member Posts: 484
    I'm not sure what are you trying to do, but you should never use xrec in this way. I hope you know what rec and xrec are used for...

    Renaming record means you are changing the fields in primary key. During renaming all fileds in all tables that have table relation to the field in this primary key are also changed. so be careful.

    After renaming record the position of your rec is likely to be somewhere else in index. so when runing next on this record can be ambigous.

    Maybe you should start with explanation what do you want...
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Sign In or Register to comment.