My knowledge about index not too much,as i told you have dublicate value for invoiceno field and also for type field how i can make index here to accept thier dublicte values and also is it possible if a user want save invoice and its invoiceno value located for the same type he return and try and try next value for invoiceno field without give error for the user depending on these error