473,385 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 1799
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 to Open/Save/Cancel? Thanks.
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 the following code in the BeforeUpdate event of the...
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 boxes. When Cancel Button is pressed which is to exit...
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 option is to convert the Login control to a...
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 is it's taking too long to process. Is there a...
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 and further processed. The tracking number is...
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 have calling a Form named “Custom_Code_lookup” which...
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 click. In case search takes long, user clicks on...
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 UI->Layer1->Layer2->Communication Layer and it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.