I am trying to create a simple CRM. I created a Method “UpdateRow” with the following code and when I try to edit a client I get an “rs.edit” error. Please see the code below:
[code]Dim dr As New DatabaseRecord
dr = new DatabaseRecord
Dim sql As String
sql = “select LastName,FirstName,MiddleInitial,DOB,SocialSecurity,Phone,Email,Address,Address2,City,State,Zip,MedicareNumber,PartAEffDate,PartBEffDate,Company,PlanType,PlanName,EffDate,Premium from people where LastName = '” + lstPeople.Cell(lstPeople.ListIndex,0) + “’ and FirstName = '” + lstPeople.Cell(lstPeople.ListIndex,1) + “’ and MiddleInitial = '” + lstPeople.Cell(lstPeople.ListIndex,2) + “’ and DOB = '” + lstPeople.Cell(lstPeople.ListIndex,3) + “’ and SocialSecurity = '” + lstPeople.Cell(lstPeople.ListIndex,4) + “’ and Phone = '” + lstPeople.Cell(lstPeople.ListIndex,5) + “’ and Email = '” + lstPeople.Cell(lstPeople.ListIndex,6) + “’ and Address = '” + lstPeople.Cell(lstPeople.ListIndex,7) + “’ and Address2 = '” + lstPeople.Cell(lstPeople.ListIndex,8) + “’ and City = '” + lstPeople.Cell(lstPeople.ListIndex,9) + “’ and State = '” + lstPeople.Cell(lstPeople.ListIndex,10) + “’ and Zip '” + lstPeople.Cell(lstPeople.ListIndex,11) + “’ and MedicareNumber '” + lstPeople.Cell(lstPeople.ListIndex,12) + “’ and PartAEffDate '” + lstPeople.Cell(lstPeople.ListIndex,13) + “’ and PartBEffDate '” + lstPeople.Cell(lstPeople.ListIndex,14) + “’ and Company '” + lstPeople.Cell(lstPeople.ListIndex,15) + “’ and PlanType '” + lstPeople.Cell(lstPeople.ListIndex,16) + “’ and PlanName '” + lstPeople.Cell(lstPeople.ListIndex,17) + “’ and EffDate’” + lstPeople.Cell(lstPeople.ListIndex,18) + “‘and Premium’” + lstPeople.Cell(lstPeople.ListIndex,19) + “’”
Dim rs As RecordSet
rs = peopledb.SQLSelect(“people”)
rs.Edit
rs.field(“LastName”).StringValue = trim(txtLastName.text)
rs.field(“FirstName”).StringValue = trim(txtFirstName.text)
rs.field(“MiddleInitial”).StringValue = trim(txtMiddleInitial.text)
rs.field(“DOB”).StringValue = trim(txtDOB.text)
rs.field(“SocialSecurity”).StringValue = trim(txtSocial.text)
rs.field(“Phone”).StringValue = trim(txtPhone.text)
rs.field(“Email”).StringValue = trim(txtEmail.text)
rs.field(“Address1”).StringValue = trim(txtStreet1.text)
rs.field(“Address2”).StringValue = trim(txtStreet2.text)
rs.field(“City”).StringValue = trim(txtCity.text)
rs.field(“State”).StringValue = trim(txtState.text)
rs.field(“Zip”).StringValue = trim(txtZip.text)
rs.field(“MedicareNumber”).StringValue = trim(txtMedicareID.text)
rs.field(“PartAEffDate”).StringValue = trim(txtPartA.text)
rs.field(“PartBEffDate”).StringValue = trim(txtPartB.text)
rs.field(“Company”).StringValue = trim(txtCompany.text)
rs.field(“PlanType”).StringValue = trim(txtPlanType.text)
rs.field(“PlanName”).StringValue = trim(txtPlanName.text)
rs.field(“EffDate”).StringValue = trim(txtEffectiveDate.text)
rs.field(“Premium”).StringValue = trim(txtPremium.text)
rs.Update
peopledb.Commit
rs.Close
lstPeople.cell(lstPeople.ListIndex, 0) = trim(txtLastName.text)
lstPeople.cell(lstPeople.ListIndex, 1) = trim(txtFirstName.text)
lstPeople.cell(lstPeople.ListIndex, 2) = trim(txtMiddleInitial.text)
lstPeople.cell(lstPeople.ListIndex, 3) = trim(txtDOB.text)
lstPeople.cell(lstPeople.ListIndex, 4) = trim(txtSocial.text)
lstPeople.cell(lstPeople.ListIndex, 5) = trim(txtPhone.text)
lstPeople.cell(lstPeople.ListIndex, 6) = trim(txtEmail.text)
lstPeople.cell(lstPeople.ListIndex, 7) = trim(txtStreet1.text)
lstPeople.cell(lstPeople.ListIndex, 8) = trim(txtStreet2.text)
lstPeople.cell(lstPeople.ListIndex, 9) = trim(txtCity.text)
lstPeople.cell(lstPeople.ListIndex, 10) = trim(txtState.text)
lstPeople.cell(lstPeople.ListIndex, 11) = trim(txtZip.text)
lstPeople.cell(lstPeople.ListIndex, 12) = trim(txtMedicareID.text)
lstPeople.cell(lstPeople.ListIndex, 13) = trim(txtPartA.text)
lstPeople.cell(lstPeople.ListIndex, 14) = trim(txtPartB.text)
lstPeople.cell(lstPeople.ListIndex, 15) = trim(txtCompany.text)
lstPeople.cell(lstPeople.ListIndex, 16) = trim(txtPlanType.text)
lstPeople.cell(lstPeople.ListIndex, 17) = trim(txtPlanName.text)
lstPeople.cell(lstPeople.ListIndex, 18) = trim(txtEffectiveDate.text)
lstPeople.cell(lstPeople.ListIndex, 19) = trim(txtPremium.text)
[/code]
What am I doing wrong on this. I have another application that I created that uses the exact same code just less fields and works perfectly fine but this one is giving me an issue.