Hi,
Your database does not contain records. The request returns NULL.
This can be avoided by using IFNULL in the query.frmProd_Add.txtProdCode.Text := IntToStr(SQLExecute('SELECT IFNULL(MAX(id),0) + 1 FROM Products'));
Hi Sparrow,
thanks for the response.
i already changed my syntax it works.
but how can i put the prefix "P" to on the id number that will end up like this "P0001"
thanks again