Page 1 of 1

Subform: auto-increment

Posted: Mon Apr 23, 2012 7:51 pm
by ruiascensao
Hi,

I use in my forms:

Code: Select all

if('#clone#' == '1' or '#recordID#' == '-1'){     //-- this is a new record

   nuRunQuery("INSERT INTO testa_counter (tc_text) VALUES ('1')");

   $s  = "UPDATE testa SET ta_customer_no = '" . mysql_insert_id() . "' ";
   $s .= "WHERE testa_id = '#newID#'";

   nuRunQuery($s);

}
Is it possible to have something similar for the subform?

Best Regards,
Rui

Re: Subform: auto-increment

Posted: Mon Apr 30, 2012 10:08 am
by ruiascensao
Hi Steven,

Any idea????

Best Regards,
Rui

Re: Subform: auto-increment

Posted: Tue May 01, 2012 1:47 am
by admin
Rui,

On "After Save" you will simply need to run a query to get all the records in the subform that don't have numbers yet and update them one at a time, the same way you have been doing just one.

Steven