Goto record in code

allenman
allenman Member Posts: 37
Hello,

Hope this is a simple question.

In code, how can I go to a different record and make it the current record displayed on the form.
I know the Primary Key of the record I want to go to.

Regards

SteveA

Comments

  • kriki
    kriki Member, Moderator Posts: 9,121
    Something like this:
    GET(PrimaryKeyFieldValue,SecondaryKeyFieldValue,...);
    

    or also:
    "Primary Key Field" := PrimaryKeyFieldValue;
    "Secondary Key Field" := SecondaryKeyFieldValue;
    ...
    FIND('=');
    

    Maybe it is necessary at the end of your code to put
    CurrForm.UPDATE(FALSE);
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • allenman
    allenman Member Posts: 37
    Thanks kriki

    I tried your code and can confirm that the following worked:

    Get(Primary Key);
    CurrForm.UPDATE(FALSE);


    Regards,
    SteveA