Undo Multiple line Edits/Add/Delete in Sub form // 3rd time still no reply

S

Syed Ubaid

Hi,

I have a problem in Main / Subform.

===========================================================
Scenario:

User is creating or editing Orders in the Orders form
provided in example Access 2.0 Northwind Traders database
NWIND.MDB). User edits order information in the main
form and edits/adds/deletes multiple line items in the
subform, then decides to abort the editing. Microsoft
Access has already committed the main form record to
the Orders table as well as the multiple line item edits.
Undo from the Edit menu is not available.
===========================================================

Now I want to Undo this Add/Edit/Delete in Subform if user
press Cancel or Undo button in Main form to cancel any
update (in Main or Subform). Microsoft has already provide
a solution for MS Access 2000 or later by creating a
temporary table, which held record temporarily before
inserting/updating in real table but I need some other
solution.

Any possiblity. I would appreciate if you could provide me some
sample code.

Thanks.

Syed
 
A

Allen Browne

Syed, this is not possible.

Nearest you can come is to write the edit/insert/delete infor to a temp
table, and then make the real changes to the real changes from this table
later.
 
A

Allen Browne

Whatever suits you. Two may be easier than one.

This is relatively easy if you are only concerned with new entries from one
user at a time. Things get more messy if there are multiple users, and you
need to consider what they may have in their various temp tables at the same
time and in addition to the real table, or if you are handling edits and
deletes via a temp table and still sharing the data amongst multiple users.
 
S

Syed Ubaid

Thanks for your reply. Confirmation from developer like you ensures that
there is no other way but temp table. However I will be more thankful if
you may confirm should it require 1 temp table (for main/subform) or
two different tables (1 for Main and 1 for subform.)

Thanks

Syed
 
A

Adrian Jansen

Without the original .mdb, its impossible to see or modify the code, so you
cant hope to modify that database.

But it is possible in principle to do an UNDO without a temp table. When
you do edits, just read ( in code ) the previous values into arrays,
holding enough that you can save to any reasonable depth. Then an UNDO only
has to write the original data back from the arrays to the table fields. Of
course you must be absolutely certain that no error will crash your code,
else you lose all the array variables. I wouldnt do this in an application
that had to be absolutely bulletproof, but just to point out that an UNDO is
possible without temp tables.
--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
S

Syed Ubaid

(I posted this issue and got a reply from Mr. Allen,
I am again posting this as I saw/use the solution of
the same issue.. )

Currently I m working in a organization where a MS ACCESS 97
database is used over a network. I some how make to view the
detailed structure of DB but couldn't read any code from MDE
(as it not viewable).

The developer has somehow (how??) managed to UNDO the
multiple line/record add/edits in subform without creating any temp
table.I check the DB while editing/adding but there was no temp
table.I contacted him for help but he has moved to Gulf. It seems
he managed UNDO of multiple lines/record in subform by some
piece of code. it might be TRANSACTION or some other way..
I can also send u the database, MDE & MDW for review if required
(DB requires specific settings like must be placed in D drive sharing
as ser_D...etc)

It shows possibility of UNDO via code...can u help me in that CODE..??


Syed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top