Thanks guys, Yes, the field is auto-increment. Having just discovered it, I thought "last_insert_id" would be a bit more elegant than MAX(). Thanks again -- View this message in context: http://old.nabble.com/mysql--last_insert_id-tp34173030p34177606.html Sent from the gambas-user mailing list archive at Nabble.com.