Hi Guys,
I am working with a billing Database. I have a table tblPurchase and tblPurchaseDetails. tblPurchase has a primary key PurchaseID which is autonumber field.
Now most of the time invoices and invoices details, needs to be imported through excel. Recently while importing i faced an error, due to which tblPurcahse was imported but tblPurchaseDetails failed to import. I ran the process again after correcting the error and everything worked fine, but now there were two entries for the same invoice under different PurchaseID. I would like to control this error.
tblPurcahse has Invoice Number, but it could be same from different suppliers, hence cant use Invoice number alone as unique. I was thinking of making a unique with combination of supplier and invoice number as that can never be same in combination. How can this be achieved?
I already have lots of data in the table. Was thinking of making both Invoice Number and SupplierID_FK as indexed with no duplicates. Would this solve the problem? Need your advise, to avoid any future problems.
Thanks and Regards
Deepak Gupta