View Full Version : saving records to a temp table??


amoona
01-30-2005, 10:30 PM
hi,

i have a form with a subform, when the user edit the data i want these records to be saved into a temporary table before editing. and when the users choose to cancel the edit i want the data from this temp table to be retreived in my fields again and saved into my actual table..

can anyone help me (please if u can show me how to save the fields into the temp table and how to retreive them i'ld really appreciate it)

thanxxx in advance

pono1
01-30-2005, 10:59 PM
Before going down this path, you might want to first look up undo in the Help file... Calling Me.Undo in a button's click event handler resets the controls. The user can also tap Esc on a control-by-control basis to bring back the old values.

Regards,
Tim

amoona
01-30-2005, 11:07 PM
the undo won't work for me.. because when moving from the main form to the subform the data gets to be saved into the table.
when adding a new record and the user wants to cancel it i just delete that new record but for editing a record that's not possible..
i tried putting cancel = true in beforeupdate but by that i can't move to the subform...
if there is a better way than creating a temp table please tell me.. if not please help me with the code....


thank you..

amoona
01-30-2005, 11:57 PM
problem solved :)
for some reason the undo is working fine now

Pat Hartman
01-31-2005, 01:14 PM
Undo shouldn't be working for you. When you move the cursor to the subform the main form's record is saved. After that, you can no longer undo the previous change.

amoona
01-31-2005, 09:00 PM
i know.. i was amazed my self coz i tried it before and it didn't work..

now when i am adding a new record and click on undo it deletes the record,
when i edit a record and click on undo it undo's what has been written..

i don't know how it's doing it but for some reason it's working..

pono1
01-31-2005, 11:13 PM
Works for me using Access 2000. Ctrl-Z is a short cut key that calls Undo as well. Keep in mind that if you, say, make a change on the main form, move to the subform, change some entries there, and then move back to the Main form and hit Ctrl-Z, the main form's record changes are undone but any changes on the subform remain in place. You can move back to the subform, however, and undo the last changed record assuming you didn't move to another record before hopping back to the main form. It is a little confusing.

Regards,
Tim

amoona
01-31-2005, 11:22 PM
thanxx Tim...

what i did was after undoing the main form i set focus on the sub form and then undid it.


Thank you alot
:)

pono1
01-31-2005, 11:33 PM
You're welcome.

Regards,
Tim