link between main and subform

Hi I have a Form and a Subform. This application is used to generate invoices. But it is different from the Navision one. In the sense the invoice number is generated only after selecting the JobNo.(and based on some conditions). And also a job can have more than one invoice number. So suppose if i have created an invoice for Job1 with invoice number as INV1, then i enter lines for this invoice. Now if i want to create a second invoice for the same Job1, when i select the Job1 and generate the invoice Number say INV2 and when i go to the subform i can see the lines created for the same Job1 of the previous invoice INV1. Which is not anticipated, i want the subform not to show any lines if exist for any job previously. Each time i select a jobno and generate an invoice number then the lines should be emty until i enter values The PK for the header table is JobNo. and InvoiceNo The Pk for the lines table is JobNo. and LineNo The link between main form and subform is JobNo. can this be achieved. Thanx Kumar

This is not an error in Navision, and in addition is is answered in another forum. The answer can be found here: Topic closed. Lars Strøm Valsted ------------------------- Software development today is a race between the programmers trying to make better and more foolproof programs, and the universe trying to make bigger idiots. So far the universe is winning. Edited by - lstroem on 2002 Feb 22 09:11:59