473,795 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1831
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*********@ho tmail.com> wrote in message
news:40******** **************@ ptn-nntp-reader01.plus.n et...
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
3789
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
3344
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 option group. If MsgBox("Change?", vbYesNo) = vbNo Then Cancel = True End If Thanks!
3
2415
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 from the current page and go to the previous page, the validation controls activate because data has not been entered, and the user cannot cancel. I have used Response.Redirect(webpage) but the validations activates and unless I enter some data...
14
2634
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 template which is not such a bad thing in itself but it means all other controls in the application must also be converted to templates to maintain a consistent UI. So much for writing 70% less code when foolish morons release a control with no cancel...
5
1826
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 way to do this? How can I pop up another dialog box or message in this dialog form for user to click on a Cancel button if it's taking to long to display the report? -- Thanks.
1
2805
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 mandatory, unique and non-zero, but _cannot_ be obtained or assigned automatically by Access (due to business rules ). Table A is the receive table Columns: AID, ReceiveDate, CompanyID
3
2265
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 allows a user to select data for the report. I have a hidden txt object within this form named txtContinue which is either set to “no” or “yes”. I believe I have everything running correctly except for my cancel code below. When the Cancel button is...
2
1716
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 Cancel and he remains on the same page without any result. basically i do not want web client to wait for result. he should get option to cancel. Please help me, this is urgent. Thanks
16
2439
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 blocks (the server is executing somthing where which takes time)
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9522
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10217
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7544
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5566
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2922
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.