Any ideas on how to add multiple items or transactions to one Invoice No? I do not have the Invoice No set as the primary key in the database because when I went to add a second line onto the invoice it says that I can not have a dup key, so I made the line no the primary key. But, I have to rig it to accept it. (See code). Also, the invoice no is always saying -1, how can I get the number to change so that I may finish this program.
See? I have to rig it, but like I said, the Invoice No is not updating, it is always being saved as (-1) which is ticking me off.Code:Try Me.InvoicesBindingSource.EndEdit() Me.InvoicesTableAdapter.Update(Me.CloseoutsDataSet.Invoices) InvoicesBindingSource.AddNew() InvoiceNoTextBox.Text = Label1.Text Catch ex As Exception MessageBox.Show("No New Line Has Been Entered!") End Try




Reply With Quote