I can load my edit form withthe selected account from the datagridview on form1
I can update aany of my information but when I save the information it updates the first account in the database.
How do I save to the selected account only?
This is my save button:
'saves the updates to the database and closes form
Dim intResponse As String
intResponse = MsgBox("Do you want to SAVE Changes to this record?", vbOKCancel, "Save?")
If intResponse = vbOK Then
' PbDealersDS.dealer(0).Address_Line1 = Address_Line1TextBox.Text
AutoBillDS.Customer(0).Location = TxtLocation.Text
AutoBillDS.Customer(0).Attention = TxtAttention.Text
AutoBillDS.Customer(0).Address = TxtAddress_Line1.Text
AutoBillDS.Customer(0).City = TxtCity.Text
AutoBillDS.Customer(0).State = TxtState.Text
AutoBillDS.Customer(0).Zip = TxtB_Zip.Text
AutoBillDS.Customer(0).Phone = MTBPhone.Text
AutoBillDS.Customer(0).Anniversary = LblAnniversary.Text
'AutoBillDS.Customer(0)Last_Update = LblUpdated.Text
AutoBillDS.Customer(0).Comments = TxtComments.Text
AutoBillDS.Customer(0).Bill_To = TxtBill_To.Text
AutoBillDS.Customer(0).Attent_to = TxtAttention_2.Text
AutoBillDS.Customer(0).Address_to = TxtB_address.Text
AutoBillDS.Customer(0).City_to = TxtB_City.Text
AutoBillDS.Customer(0).State_to = TxtB_State.Text
AutoBillDS.Customer(0).Zip_to = TxtB_Zip.Text
AutoBillDS.Customer(0).Phone_to = MTBB_Phone.Text
AutoBillDS.Customer(0).Next_Billing = DTP1NextBDate.Text
AutoBillDS.Customer(0).Monthly = RBMonthly.Checked
'AutoBillDS.Customer(0).Bi-Monthly = RBBMonthly.Checked
AutoBillDS.Customer(0).Quarterly = RBQuarterly.Checked
AutoBillDS.Customer(0).Annual = RBAnnual.Checked
AutoBillDS.Customer(0).Bi_Annual = RBBAnnual.Checked
'AutoBillDS.Customer(0).Late_Charge = TxtLate.Text
AutoBillDS.Customer(0).Use_late = CBUseFlat.Checked
'AutoBillDS.Customer(0).Flate_Rate = TxtFlatRate.Text
'AutoBillDS.Customer(0).Current_Charges = TxtCCharges.Text
'AutoBillDS.Customer(0).Billing_Cycle = CheckBox10.Checked
'AutoBillDS.Customer(0).Auto_Invoice = CheckBox8.Checked
'AutoBillDS.Customer(0).Auto_Statement = CheckBox7.Checked
'AutoBillDS.Customer(0).Bank_Account = TxtBankAccount.Text
'AutoBillDS.Customer(0).Routing = TxtRoutingNumber.Text
'AutoBillDS.Customer(0).Credit_Card = TxtCreditCard.Text
'AutoBillDS.Customer(0).Exp_Date = TxtExpDate.Text
Me.Validate()
Me.CustomerBindingSource.DataSource.GetType()
Me.CustomerBindingSource.EndEdit()
Me.CustomerTableAdapter1.Update(AutoBillDS)
Me.TableAdapterManager.UpdateAll(AutoBillDS)
MsgBox("Updates Successfully Saved to Customer DataBase")
Me.Close()
End If
If vbCancel Then
Exit Sub
End If