Bound Controls retaining changes after cancelupdate

Bound Controls retaining changes after cancelupdate

Post by ph4t.. » Fri, 01 Oct 1999 04:00:00



I am writing a form using the VB6 and the MS
bindingcollection object, the controls are all
bound to a field in a Access 97 database.  If the
user changes a value in one of the forms and
chooses the cancel button, I call the
recordset.cancelupdate method, this "in theory"
should make all of the controls in the recordset
revert back to the value they contained before
the change was made.  However, the cancelupdate
method is not working, when the changes are made
they are automatically retaining the new values,
even if I have not called the update method yet.
Anyone have any ideas?

Tony Rath
Internet Applications Developer, RSPnet.com

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

Bound Controls retaining changes after cancelupdate

Post by Sidar » Fri, 01 Oct 1999 04:00:00


I just posted "Dataenvironment and bound controls bugging me" which states
that I was receiving a bunch of willchange events when I wasn't expecting
them.  Perhaps this is related, and perhaps bound controls inevitably to
things (like update) when we don't wan't them to (I honestly don't know).

Sidart


> I am writing a form using the VB6 and the MS
> bindingcollection object, the controls are all
> bound to a field in a Access 97 database.  If the
> user changes a value in one of the forms and
> chooses the cancel button, I call the
> recordset.cancelupdate method, this "in theory"
> should make all of the controls in the recordset
> revert back to the value they contained before
> the change was made.  However, the cancelupdate
> method is not working, when the changes are made
> they are automatically retaining the new values,
> even if I have not called the update method yet.
> Anyone have any ideas?

> Tony Rath
> Internet Applications Developer, RSPnet.com

> Sent via Deja.com http://www.deja.com/
> Before you buy.


 
 
 

1. Bound Control data refresh after CancelUpdate

Dear All:

I am having a data refresh problem with data bound
controls (TextBoxes and ComboBoxes) bound to an
adoDataControl ("adoData") when I Cancel the update in the
adoData.Recordset.

Setup is as follows:

1) on the Form, have series of Text boxes
with  "DataSource=adoData" and an appropriate DataField

2) On the Form, have series of Combo boxes with DataSource
and DataField as above, RowSource and ListField bound to a
SQL based Recordset, and an appropiate Bound column
from "adoData".

3) I fabricate an ADO Recordset "rsData" in memory (not
the result of an SQL query) - client, optimistic, static.

4) I then "Set adoData.Recordset = rsData". The whole
setup works well and all data changes and combo lists are
are as I expect. If the User clicks "Update", "adoData"
vaues are as the User entered or changed them.

5) If the User Cancels the update, I execute
the "adoData.Recordset.CancelUpadate" method to
roll "adoData.Recordset" back to its initial state (works
as expected). However, the current (e.g. rolled back)
values are not refreshed to the screen. The screen remains
as the User left it when the Cancel button was clicked.

How can I get the "after Cancel" values to reappear on the
screen for all controls bound to "adoData"? (Hopefully
automatically and all at once). I have tried the
various "Refresh" methods without success.

What is the trick?

TIA

Victor

2. Using a filter with a Report

3. EditMode not changing when deleting in a bound control

4. GPF Faults trashing databases

5. Changing bound control selection (VB4)

6. Finding & Omitting

7. Changing the recordsource to a data component for a bound control at runtime

8. Progress 8.3b and MFGPRO 8.6c, what is the problem?

9. Problem: CancelUpdate FAILS for a DataGrid bound to Oracle database

10. Problem with bound DataCombo and Masked Edit controls when changing their contents

11. Using Data-bound textboxes en the CancelUpdate method

12. Deploying ADO Data bound controls / changing connection string

13. Changing the source on an ADO recordset bound to controls