Temporary Table Question.

infonote
infonote Member Posts: 233
Hi,
A Newbie question.

In a form I have a trigger which when triggered,
I would like to populate the temp table with data from the rec.

How can this be done?

Thanks in advance

Comments

  • Belias
    Belias Member Posts: 2,998
    edited 2008-03-04
    in a form trigger, it's better to only call a function which does your code...
    BTW, declare a variable: type = record, subtype = the same record of rec.
    then click view, properties on this variable and set temporary to yes.
    after that you can use TRANFERFIELDS to copy all the values from your rec to the temptable and then use INSERT on the temptable.
    then you can use the table like any other.
    but...in which trigger you want to put your code?
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • sendoh
    sendoh Member Posts: 207
    just use insert function to insert the data in your temptable.

    try to search the forums, there's a lot of topic here regarding temptable.
    Sendoh
    be smart before being a clever.
  • infonote
    infonote Member Posts: 233
    Belias wrote:
    in a form trigger, it's better to only call a function which does your code...
    BTW, declare a variable: type = record, subtype = the same record of rec.
    then click view, properties on this variable and set temporary to yes.
    after that you can use TRANFERFIELDS to copy all the values from your rec to the temptable and then use INSERT on the temptable.
    then you can use the table like any other.
    but...in which trigger you want to put your code?

    Thanks, realized it after I submitted the post.
    Sometimes writing something down really helps you think.

    I have called a function which takes care of everything.

    Thanks a lot
  • Eugene
    Eugene Member Posts: 309
    IF Rec.FINDSET THEN
    REPEAT
      RecTemp := Rec; //copies the fields values
      RecTemp.INSERT(FALSE);
    UNTIL Rec.NEXT = 0;