Q: RejectChanges problem

  • Thread starter Thread starter Geoff
  • Start date Start date
G

Geoff

Hi

Can anybody suggest how to get round the following problem?

I have a form (form A for the sake of argument) which accepts data to be put
into a DataTable. If the cancel button is pressed, I call RejectChanges to
prevent the inputted data being passed to the DataTable. However, I also
have a button on the form which calls another form (which I'll refer to as
form B) which can also populate the table. In this form there is also a
cancel button to which I call RejectChanges i.e. in order that the data
inputted in its form can be rejected.

The problem is this, if the user inputs data in form A, and then enters form
B and inputs some data, but then decides that the last set of data is wrong
and presses Cancel then ALL the data is lost i.e. that from A and B (where
the intention is to only lose that from form B).

Now, I don't want to write any data to the database that the table is
attached to i.e. I don't want to use Update until the user leaves form A (by
pressing "OK" or something).

Can you see my problem? What I think I need is some way to say that the data
in B can be lost but without losing anything from A. Almost a "partial
reject changes". Is there such a thing?

Hope somebody can help.

Geoff
 
Yes, make the second form open in Modal, this will prevent you from
accessing form A until you finish with form B.
 
Hi Terry

I'm afraid I didn't explain myself too clearly. Basically form A and B have
access to a global DataTable. If I make changes to the DataTable in A, enter
B and make changes to the DataTable and then press Cancel (calling
RejectChanges for the DataTable) I will also reject the changes made in form
A - which is not intended i.e. all I want to do by pressing Cancel in form B
is to reject the changes made in it.

So, what I'm looking for is a way to reject the changes made in form B AND
ONLY in form B. RejectChanges seems to clear everything.

Can you help?

Geoff
 
Back
Top