473,395 Members | 1,464 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,395 software developers and data experts.

Recordset snapshot that allows editing without saving changes

Seth Schrock
2,965 Expert 2GB
I know that I can do this using a temp table, but I'm hoping for another solution that would be easier. I want to be able to open a form (in continuous view) with the current data and play with the data without the changes being saved. This includes being able to change records. I would then have Cancel and Save buttons. The cancel button would just close the form without making any changes to the data. The save button would replace the existing data with the information that is in the form. I tried using the Snapshot recordset type in the form properties, but that doesn't allow you to make any changes to the controls. Like I said, I know that I could load the data into a temp table so that all my changes, while being "saved" wouldn't change the main table and then Cancel would just empty the temp table and Save would copy the changes to the main table.

One note... With my idea, I would only be editing records, not adding or deleting. Not sure if this makes any difference.

I just want to be able to take a picture of my data, edit the picture and then choose whether or not to save my changes without being prompted for each record, but instead as a whole recordset. Hope this makes sense.
Feb 21 '14 #1

✓ answered by zmbd

Use a transaction workspace on the bound form.
Been doing this since ACC2003 based upon the ACC2000 model as described here: ACC2000: How to Control Bound Form Transactions in Access Databases

Of course, change all of the DAO3.6 references to the newer jet/ace type for ACC2007/2010 (Microsoft Office Acces 14 or something like that... I'm on the iPad writing now so no office!)

Works slicker than whale-poop-on-ice. (^_^)
HOWEVER, I HIGHLY ADVISE USING A COPY OR TEST DATABASE the first time thru with this... boy did I make a mess of things the first try... and I even used the Northwinds.MDB file.

7 2089
ADezii
8,834 Expert 8TB
I have a radical approach which in Theory I do believe should work although I have never tried it myself and I would venture to say that no one else has either. Here goes my Logic.
  1. Create an ADODB Disconnected Recordset.
  2. Assign this Recordset to the Recordset Property of your Form.
  3. Make as many changes as you like.
  4. Should you wish to Save (Save) your most recent change(s), Reconnect the Recordset to the Data Source.
  5. To discard (Cancel) ALL changes, simply leave the Recordset disconnected and Close the Connection Object.
  6. Again, strictly theoretical at this point.
Feb 22 '14 #2
zmbd
5,501 Expert Mod 4TB
Use a transaction workspace on the bound form.
Been doing this since ACC2003 based upon the ACC2000 model as described here: ACC2000: How to Control Bound Form Transactions in Access Databases

Of course, change all of the DAO3.6 references to the newer jet/ace type for ACC2007/2010 (Microsoft Office Acces 14 or something like that... I'm on the iPad writing now so no office!)

Works slicker than whale-poop-on-ice. (^_^)
HOWEVER, I HIGHLY ADVISE USING A COPY OR TEST DATABASE the first time thru with this... boy did I make a mess of things the first try... and I even used the Northwinds.MDB file.
Feb 23 '14 #3
jimatqsi
1,271 Expert 1GB
Seth,
Is this in a single-user environment? This may not be workable in a multi-user environment without locking users out of the affected rows during the "play" time.

Jim
Feb 23 '14 #4
Seth Schrock
2,965 Expert 2GB
This is a multi-user environment. Record locking shouldn't be a problem. Thanks-for the heads-up. I will look at both of these solutions tomorrow at work.
Feb 23 '14 #5
Seth Schrock
2,965 Expert 2GB
Thanks Z. That works perfectly. The instructions were very easy to follow and I've got it implemented as given in the example. Now I'll just tweak it a little so that the user can click Save or Cancel buttons and have it then do the roll-back or the commit and not prompt on closing.

Just curious, in the example given in your link, couldn't you get rid of the boolFrmSaved variable and just replace it with the boolFrmDirty variable? I didn't see anywhere in the code that the functions needed to be separated. The Form_Unload event used them separately, but I would think that instead of testing for If Me.Saved ..., just test for If Me.Dirtied. Not that it makes a huge difference, but I was just wondering if there was a reason that I was missing.
Feb 24 '14 #6
zmbd
5,501 Expert Mod 4TB
Seth, glad this worked for you. I've never actually tried to improve on this code so to answer your second question IDK. (^_^) - If you want an indepth anlysis of the code you should start a new thread with link back to this one if you desire.
Feb 24 '14 #7
Seth Schrock
2,965 Expert 2GB
It actually became useful to me when I added my Cancel and Save buttons, so I'll skip that discussion for now. Thanks again.
Feb 24 '14 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: AaronV | last post by:
I've seen a few sites that offer this, but I'm not sure how they do it. It's a form button, that when pressed, prompts the use to download a file. Like if I want my banking records, I select a date...
1
by: Dev | last post by:
Dear Friends, I am passing the image name, size (in bytes) and imgaeformat (like jpg or bmp or pdf) through the network. I want display the image into picturebox without saving image...
6
by: Mark Denardo | last post by:
My question is similar to one someone posted a few months back, but I don't see any replies. Basically I want to be able to have users upload photos and save them in a database (as byte data)...
2
by: ClearCut | last post by:
I have written a program in VB6 that opens an existing Word document and adds some text to the top of the document before printing it. Now I want to close the document without saving the changes. ...
6
by: PetyaNic | last post by:
Hello, I'm a very beginner in Javascript and sorry if my question sounds stupidly. I want to print a page without showing the print window and without saving the page as a file. I want the user...
6
by: Karl | last post by:
Hi all, It may seem like a rather odd request (or not) but I would like to be able to create a file (doc, jpg, xls or one of many other files that can be automated) on a website and stream it to...
10
prn
by: prn | last post by:
Hi all, Among other things, I maintain an Access application that I have inherited from about a half-dozen previous maintainers. :( I got a call from one of the users to the effect that one of...
2
TheSmileyCoder
by: TheSmileyCoder | last post by:
I have a form, which I open in dialog mode, and through the openArgs I set some values in the form (in a new record) thus dirtying the form. The idea is then that the user should make a selection...
1
by: lorax | last post by:
I am new to this. I am recreating a form from ACCESS 2000 in Access 2010. The problem is that ACCESS no longer allow one to close a form without saving it. Form: a search form that allows people...
0
NeoPa
by: NeoPa | last post by:
Introduction : This article relates to the long-standing (Since at least Access 2.0.) problem whereby a Form, used within a Subform of another (main) Form, will have any temporary and transient...
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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.