foreach (InvoiceEntity Invoice in InvEntityList) { // Initialize variables for determining charges ... // Make sure there is a valid service master code for this cyinvoice entServiceMaster = oServiceMaster.GetServiceMasterByStoreAndInvclass(Invoice.storeno, invoice.invclass); if (entServiceMaster.HasValues.Equals(false)) { // Skip this record because critical information is missing. string ErrorMessage; if (mmAppBase.Localize) ErrorMessage = mmAppBase.MessageMgr.GetMessage("No Service Master record."); else ErrorMessage = "No Service Master record."; Invoice.errstatus = ErrorMessage; this.DataSet.AcceptChanges(); CurrentInvoice = Invoice.cyinvoice; continue; } //Record is good so write lines to text file ... }The way I got it to work was by moving all the code inside the foreach loop to a separate method but I'd really like to use the continue option, at least in the future.