Move recordpointer of temp table

ACAEACAE Member Posts: 52
I have a form that is based on a temp table. The user want's to search in this for for a specific code, so I added a textbox where he can enter the code to search.
How can I move the recordpointer in the form to the record with the matching code ?

In a normal form you can write a 'get' to do this, but this doesn't seem to work for a temp table. Setting a filter isn't really an option I want to use

Comments

  • krikikriki Member, Moderator Posts: 9,120
    Something like in the OnAfterValidate-trigger of the field:
    tmpTemptable.GET(....);
    rec := tmpTemptable;
    CurrForm.UPDATE(FALSE);
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Hmm, I remember somewhere that there was a trick for filtering on temp tables. Let's search...
  • krikikriki Member, Moderator Posts: 9,120
    Hmm, I remember somewhere that there was a trick for filtering on temp tables. Let's search...
    Could this be it? :wink:


    Form - OnFindRecord(Which : Text[1024]) : Boolean
    tmpTempTable.COPY(Rec);
    blnFound := tmpTempTable.FIND(Which);
    Rec := tmpTempTable;
    EXIT(blnFound);

    Form - OnNextRecord(Steps : Integer) : Integer
    tmpTempTable.COPY(Rec);
    intResultSteps := tmpTempTable.NEXT(Steps);
    Rec := tmpTempTable;
    EXIT(intResultSteps);

    I have this code in the ALT+T of the Codegenius! :wink:
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • ACAEACAE Member Posts: 52
    Hi,

    Thanks for your help, this code works fine:

    tmpTemptable.GET(....);
    rec := tmpTemptable;
    CurrForm.UPDATE(FALSE);

    Andy
Sign In or Register to comment.