472,353 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

a2k - offering a Cancel option

Alot of my forms are bound.

I would like to offer a Cancel option so that they can make as many changes
as they like and still Cancel out without making any changes.

I have one idea of how to do this for new records; tag each record with a
boolean value. On clicking OK, these are all set to True and the form
closes.
If they Cancel the False records are deleted and the form closes.

Not too sure what to do if they change an existing record and then exit.

What strategies do people use? Do I have to face the task of unbinding
everything?

thanks
Martin
Nov 13 '05 #1
4 1727
Personally I've never had an app that required this processing but I can
think of lots.

I think your idea is fine. You can deal with changes by using the form
beforeupdate event to set the tag to false.

You could not do this with an unbound form. On a continuous form unbound
controls take the same value for every visible record.

I'm not sure why you think you have a problem.

Peter Russell

Deano previously wrote:
Alot of my forms are bound.

I would like to offer a Cancel option so that they can make as many
changes
as they like and still Cancel out without making any changes.

I have one idea of how to do this for new records; tag each record
with a
boolean value. On clicking OK, these are all set to True and the form
closes.
If they Cancel the False records are deleted and the form closes.

Not too sure what to do if they change an existing record and then exit.

What strategies do people use? Do I have to face the task of unbinding
everything?

thanks
Martin


Nov 13 '05 #2
Deano wrote:
Alot of my forms are bound.

I would like to offer a Cancel option so that they can make as many changes
as they like and still Cancel out without making any changes.

I have one idea of how to do this for new records; tag each record with a
boolean value. On clicking OK, these are all set to True and the form
closes.
If they Cancel the False records are deleted and the form closes.

Not too sure what to do if they change an existing record and then exit.


OK, so to summarize they can both add and edit records in your bound
form, and hitting 'Cancel' should cancel ALL the edits and updates to
all records that were made that session.

If your application is single user, no problem. Copy the recordsource
to a temporary table, add a "Dirty" flag to each new and edited record.
Upon OK'ing the session, copy/update all records with the dirty flag
set to the original table.

If your application is multi-user, you're going to have to add a
'LastEdited' timestamp to all the records in the source table. In the
temporary table include this timestamp field, do not update it if you
edit a record, but do update the dirty flag. Note that you may have to
be tricky about key generation if you can have multiple users doing this
at once. When the session is OK'ed, copy all NEW records to the source
table, and update only existing edited records if the timestamp fields
are equal. Update the timestamp fields for those records.

For records where they are not equal, some other user has already edited
them and saved their changes. Present these records to the user and
allow them 2 choices: (1) discard your changes (2) get a fresh copy of
these records so you can make the changes over again.

Nov 13 '05 #3
The simplest approach is to allow as many changes as they like TO A GIVEN
RECORD, and give them the option to cancel by displaying a MsgBox in the
BeforeUpdate event. But my understanding, though it isn't crystal clear to
me, is that you want to allow the user to change as many fields in as many
records in a "session" and then cancel _all_ those changes.

I think the suggestions you have already received, of using a temporary
table to hold the modified records, and then doing a "batch" update on
closing the form are the simplest way to handle that. But it is not very
"granular" -- only allowing the user to cancel _all_ changes, not _specific_
ones.

Larry Linson
Microsoft Access MVP
"Deano" <de*********@hotmail.com> wrote in message
news:40**********************@ptn-nntp-reader01.plus.net...
Alot of my forms are bound.

I would like to offer a Cancel option so that they can make as many changes as they like and still Cancel out without making any changes.

I have one idea of how to do this for new records; tag each record with a
boolean value. On clicking OK, these are all set to True and the form
closes.
If they Cancel the False records are deleted and the form closes.

Not too sure what to do if they change an existing record and then exit.

What strategies do people use? Do I have to face the task of unbinding
everything?

thanks
Martin

Nov 13 '05 #4
Larry Linson wrote:
The simplest approach is to allow as many changes as they like TO A
GIVEN RECORD, and give them the option to cancel by displaying a
MsgBox in the BeforeUpdate event. But my understanding, though it
isn't crystal clear to me, is that you want to allow the user to
change as many fields in as many records in a "session" and then
cancel _all_ those changes.

I think the suggestions you have already received, of using a
temporary table to hold the modified records, and then doing a
"batch" update on closing the form are the simplest way to handle
that. But it is not very "granular" -- only allowing the user to
cancel _all_ changes, not _specific_ ones.

Larry Linson
Microsoft Access MVP


Thanks for all the replies.

My viewpoint is based on what I've seen in other apps used in my area of
work. Basically you may enter a form, make some changes and then you have
to Save. If you don't save and instead click Cancel then any changes you've
made are lost.

I like this in the sense that it offers a safety net of sorts. Sometimes I
have to show someone a record and then change a few things to show another
possible scenario. But I actually want to keep the original data so a
Cancel option is quite useful.

As I see this approach in other programs and it doesn't seem to bother
users, it's an attractive option to implement.
Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: eddie wang | last post by:
Excel open automatically without giving a dialog box option to Open/Save/Cancel using filesys.createTextFile. How to pop up the dialog box option...
2
by: Corrine | last post by:
Is there a way to cancel a change in an option group? The option group still changes to the option clicked on when clicking on the NO button with...
3
by: MB | last post by:
Hi, I am doing a project which uses asp.net to develop its forms. The form uses validation web controls to validate the data entered in text...
14
by: clintonG | last post by:
This is an appeal for peer support sent to Microsoft as will be noted in closing. The Login control does not include a Cancel button. The only...
5
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using vs2005, .net 2.0. I have a form with crystal Viewer that I call as showdialog. I want to give the user an option to cancel out of it...
1
by: Richard | last post by:
A shipment of material is received. The shipment contains several items. Each item is assigned an internal tracking number for auditing purposes...
3
by: Birky | last post by:
Hello, I’m hoping you can help me out with two issues I’m having with my code. I have an Access Report named Report_Project_Event_Log which I...
2
by: tirath | last post by:
hi, I have a web site where user provide some search criteria and click on button "Search". I want to provide a "Cancel" button which user can...
16
by: parez | last post by:
I start a BackGroundWorker to populate a grid. It is started off in the ui layer The thread follows( cannot think of a better word) the path ...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.