• change the "reference number" to auto-increment which will take care to generate the unique number everytime.

    ----------
    Ashish