
AddNew/REquery method of ADO Recordset not Working?
I am having a problem with an ADO recordset created via DED.
I have an unbound DataList which is used to select an address. When an
address is selected, rscmdHomes bookmark is set to the selected item in
the DataList. As I click different addresses, the other data controls
all show the appropriate data.
Using a popup menu, I can add a record to rscmdHomes:
With devVirtuality.rscmdHome
.AddNew
!CompanyID = devVirtuality.rscmdCompany!CompanyID
!HomeAddress = strAddress
.Update
.Requery
End With
I then rebind all of the data controls on the form which are bound to
the rscmdHomes recordset:
Set txtHomeAddress.DataSource = devVirtuality
Set txtHomeCity.DataSource = devVirtuality
Set cmbHomeState.DataSource = devVirtuality
Set txtHomeZip.DataSource = devVirtuality
Set txtListingPrice1.DataSource = devVirtuality
Set txtListingPrice2.DataSource = devVirtuality
Set txtHomeTaxes.DataSource = devVirtuality
According to Q191457, this should not only update the underlying
recordsource, but also update the controls bound to that recordsource.
I can look in the database and the new record is added to the table. The
problem is that whenever I then modify any of the other info for the new
Home and then click on a different home, I get an Operation Cancelled
runtime error and the record is never updated.
If I restart the program, I can then change data for that home. I don't
think my users want to have to exit the program every time they add a
new home.
Can anyone suggest how I can alleviate this problem so that the new
record can be edited?
Thanks,
Keith Bobick
BeekerSoft