Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Subform: auto-increment

Post Reply
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

Subform: auto-increment

Unread post 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
BR
Rui
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

Re: Subform: auto-increment

Unread post by ruiascensao »

Hi Steven,

Any idea????

Best Regards,
Rui
BR
Rui
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Subform: auto-increment

Unread post 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
Post Reply