By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,266 Members | 1,300 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,266 IT Pros & Developers. It's quick & easy.

Q: RejectChanges problem

P: n/a
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
Feb 12 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Yes, make the second form open in Modal, this will prevent you from
accessing form A until you finish with form B.

--
Terry Burns
http://TrainingOn.net
"Geoff" <no********@email.com> wrote in message
news:Yq******************************@pipex.net...
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

Feb 12 '06 #2

P: n/a
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
"Terry Burns" <me@mine.com> wrote in message
news:uR**************@TK2MSFTNGP11.phx.gbl...
Yes, make the second form open in Modal, this will prevent you from
accessing form A until you finish with form B.

--
Terry Burns
http://TrainingOn.net
"Geoff" <no********@email.com> wrote in message
news:Yq******************************@pipex.net...
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


Feb 12 '06 #3

P: n/a
OK then you need two tables as it does not know who made the changes.

--
Terry Burns
http://TrainingOn.net

"Geoff" <no********@email.com> wrote in message
news:2P********************@pipex.net...
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
"Terry Burns" <me@mine.com> wrote in message
news:uR**************@TK2MSFTNGP11.phx.gbl...
Yes, make the second form open in Modal, this will prevent you from
accessing form A until you finish with form B.

--
Terry Burns
http://TrainingOn.net
"Geoff" <no********@email.com> wrote in message
news:Yq******************************@pipex.net...
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



Feb 12 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.