Maneesh

Maneesh

  • NA
  • 6
  • 10.4k

Adding another New Row for the same ID

Nov 14 2011 12:08 AM

I have a simple application for taking Customer orders and their Products. I am using Visual Studio 2008 Express Edition and MS Access 2007.

My application uses multiple forms. One of the forms is an Add form from where a New Customer along with his/her details like address, phone, city, state etc can be added. Another form is for the Product Details to be added.

I want to know how to add Multiple Rows for the same CustomerID record, as a Customer can order multiple products. I am using the following code for the Add button:

 Private Sub cmdAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAdd.Click          MyBindingSource.EndEdit()         DialogResult = Windows.Forms.DialogResult.OK      End Sub 


This adds a new Customer into the Database. I have another code for Auto Incrementing the CustomerID.

Now I need to know how to add 2 or more rows for this same CustomerID record.

How can I do this ? 

Can anyone help please ?


Answers (1)