How can I "undo" an entry on a form/subform while still entering data ? 11-16-07

Hi

I have a form/subform for entering invoice data.  What can I do if I
realize that I have already entered the invoice ?  Example:  I enter
the main form data and enter 5 lines of detail on the subform and then
I realize that I have already entered this invoice before ?  I would
love to have a button that I could click that "undoes" the entire
entry.

Is there a way to do this ?

Thanks in advance
Mark Thornblad
0
mthornblad
11/16/2007 5:37:05 AM
access.forms 6864 articles. 2 followers. Follow

1 Replies
706 Views

Similar Articles

[PageSpeed] 1

When you enter the main form record, and move into the subform to enter the 
line items, the header record saves into its table. Consequently you can't 
just "undo" the record and whatever line items you have entered in the 
subform.

Perhaps you could add a Delete button to the main form, and use cascading 
deletes to delete the line items in the subform as well:

1. Open the Relationships window (Tools menu, or Database tab of the ribbon 
in A2007). Create a relationship between tblInvoice.InvoiceID (the primary 
key) and tblInvoiceDetail.InvoiceID (the foreigh key), and check the boxes 
for:
     [ ] Referential Integrity
     [ ] Cascading Deletes

2. Open your main form in design view, and add a command button with these 
properties:
    Name        cmdDelete
    Caption      Delete this invoice
    On Click    [Event procedure]

3. Click the Build button (...) beside the On Click property.
Access opens the code window.
Set up the code so it looks like this:

    Private Sub cmdDelete_Click()
        If Me.Dirty Then
            Me.Undo
        End If
        If Not Me.NewRecord Then
            RunCommand acCmdDeleteRecord
        End If
    End Sub

Clicking the button will now delete the invoice, and the cascading delete 
will delete any line items in that invoice.

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<mthornblad@gmail.com> wrote in message
news:5256ae83-d09c-4c0a-8e83-3f617f0909e2@c29g2000hsa.googlegroups.com...
>
> I have a form/subform for entering invoice data.  What can I do if I
> realize that I have already entered the invoice ?  Example:  I enter
> the main form data and enter 5 lines of detail on the subform and then
> I realize that I have already entered this invoice before ?  I would
> love to have a button that I could click that "undoes" the entire
> entry.
>
> Is there a way to do this ?
>
> Thanks in advance
> Mark Thornblad 

0
Allen
11/16/2007 6:26:57 AM
Reply:

Similar Artilces:

Undo feature in FRx reporter
What is the possibility of incorporating an Undo facility in FRx report writer? At present; row, column and tree formats are amended and if an undo is required the format is exited and then re-entered to remove ALL changes made. What would be perfect would be the undo facility as found in Microsoft Excel. Thanks for the support. -- Clint E ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow thi...

How to stop "Undo" across multiple spreadsheets
When I am working between multiple separate worksheets, Undo will work backwards across all of the worsheets that I have open. How do I get the Undo function to work only on the worksheet that I am currently on? ...

How to undo the way a page has been setup?
I have a file that I created from an e-mail attachment and there are three parts, on the second part there are two pages that should only be one page like the other two, how do I fix this so the second part looks lik the others? Maybe you can use View|Page Break Preview and drag those dotted lines where you want the page breaks to be. (View|Normal will make it look, er, normal.) Display Report wrote: > > I have a file that I created from an e-mail attachment and there are three > parts, on the second part there are two pages that should only be one page > like the other two, ...

Undoing changes in WORD
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) I forgot to click 'Save as' before using the document as a template and hence lost ALL of my original work (silly error!) <br><br>Is there any way at all of going back through log of all changes made and recovering this information - either in Word or perhaps a back up on my computer? <br><br>I would be VERY grateful. <br><br>Thank you. No, not once you have closed the document. When you close a file, Word trims out the UNDO buffer, leaving only the saved version. Sorry. On...

undoing he booklet page setup
I print many multi-page booklets and occasionally need to create a pdf file from the same document. My problem is that after I setup my document to print as a booklet Publisher seems to keep that format no matter what print or page layout changes I make. So whenever I convert to pdf format it creates the pdf file so it looks like a booklet. Has anyone else experienced this? If so how do you change the layout so it will pdf as a single sided one page at a time file? Thanks for any ideas you can give me!! Open your booklet, Printer setup, PDF, create a custom 5.5 x 8.5 setting in the ...

How can I "undo" an entry on a form/subform while still entering data ? 11-18-07
Hi I posted this question a couple of days ago and got 1 response but couldn't read it. Hopefully someone will have and answer. I have a form/subform for entering invoice data. What can I do if I realize that I have already entered the invoice ? Example: I enter the main form data and enter 5 lines of detail on the subform and then I realize that I have already entered this invoice before ? I would love to have a button that I could click that "undoes" the entire entry. How can this be accomplished ? Thanks Mark <mthornblad@gmail.com> wrote in message news:81271...

Can I undo a sort after saving.
I have a workbook that I have placed columns across that is Date, State, Client, Class, County, Contact Person, Phone, EXT, Status, Map Code, Fax and Reference/comments. I corrupted this thing and have several (save as) with different file names as for recovery but I am afraid that I must of ruined on of the first ones. I will have to do more investigation in the morning. I think that I have done a sort function accidently, that sorted only one or to columns so now the name doesn’t match Client or Phone. I am not sure yet but Name may match phone number but I know some of them do not match...

can't "undo" to original document
I accidentally hit Ctrl S and saved a document. Unfortunately, I meant to do a Save As, instead. Is there anyway to recover my original document? I haven't closed the file, yet. I know in Word you can "undo" multiple actions. Is it possible to do that in Excel, also? If running version 2007, saving does not clear the undo stack so you = should be able to undo your changes. Earlier versions do clear the stack so no reversal is available. Gord Dibben MS Excel MVP On Sat, 5 Jun 2010 07:40:06 -0700, lovetoshop1128 <lovetoshop1128@discussions.microsoft.com>...

undo program removal
I removed a program (windows live). it appeared as though I had both windows live and window live hotmail. I wanted to keep windows live hotmail and get rid of windows live.com. It appears as though I remoed both. how do i get it back? Yukon2007 wrote: > I removed a program (windows live). it appeared as though I had > both windows live and window live hotmail. I wanted to keep > windows live hotmail and get rid of windows live.com. It appears as > though I remoed both. how do i get it back? Install them. -- Shenan Stanley MS-MVP -- How To Ask Questio...

How do I undo or delete the auto MS Clip Organizer?
I allowed the MS ClipArt Organizer (in MS PUB 2003) to manage all my images on my system automatically (major slip of the right index finger) and discovered I have way too many images available. Doesn't make it practical to manage removing them manually. I would like to redo the process, eliminate numerous images added to the MS ClipArt organizer but can't even figure out where or what file the catalog is written to. Does anyone have any suggestions re: this dilema? Many thanks in advance. I can also be reached at terryp123@cox.net. Thanks ... Terry Re-name the MStore10.mgc to...

How to undo a voided transaction
My employee mistakenly voided a credit card transaction. How do you undo that? If I go to the VisaNetTransaction table and go to the original transaction number and then change the "status", does that bring it back into the batch? (I have not settled the original or voided transaction). If this works, what do I do the void transaction?RMS Version 2.0 Not sure how to "un-void" a transaction but as a last resort: 1. settle both the charge and the void transactions. 2. call your merchant services provider and obtain the credit card number for the original transaction....

have saved a doc, and its overwritten everything, how can i undo
I have saved a document by accident, overwriting all the data, is there anyway i can recover the document in its original form? If you didn't save a backup, probably not. "forks" wrote: > I have saved a document by accident, overwriting all the data, is there > anyway i can recover the document in its original form? ...

Undo & Redo grayed out
Don't know why but want to fix it. I have neither option available. I have tried old diagrams new diagrams and have the same condition. It's got to be something stupid simple but I can't get them turned on. BTW, don't have the same issue with any other Office product. Thanks, Jim Seems like number of undo/redo actions (options) is set to zero. Change it to another value than 0. Frank W. jgeidl <jgeidl@discussions.microsoft.com> schrieb in im Newsbeitrag: 922A29DC-011A-4226-9B91-ADDF5F8AC93B@microsoft.com... > Don't know why but want to fix it. I have ...

undo (edit: ctrl+z)
2005 standard my undo feature does not seem to be working correctly. is their a setting to turn this on / keep a history? ...

Undo Button Click change
I have a Sort button on my worksheet which sorts a range od data alphabetically. On clicking the sort it sorts the data, But if I try to undo that change it does not work, Ctrl+Z is disabled. Can anyone let me know (VBA code if needed) how I can take care of this? Thnx hi, Excel has a lot of built in niceities, the undo is one of them. but they only work when doing things manually. macro code bypasses all the built in niceities. You can not undo anything done with macro code. If you want to undo your sort, then you will have to write code that will resort your data. maybe another butt...

Can I limit undo store.
WORD 2003 I have an application that creates a WORD document by pasting into WORD. I think the undo store is depleting available memory (many thousand items). Can I turn off or limit the items kept for undo? You can't turn it off. At various points in your macro, you can call the method ActiveDocument.UndoClear to empty the list. Unless your computer is seriously memory-poor, though, this probably won't help much. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so ...

Undoing Bank Reconciliation #2
Hello: I know that you cannot undo a Bank Rec once it is done for a period. Also, TK says that all you can do is enter the new Bank Statement Ending Balance and reconcile that one "new" item that needs reconciling for that period. So, is there any sort of third party tool out there that will allow this feat to be accomplished? At a minimum, if the Bank Rec cannot be undone, it would be nice if you could view the impact of the new transaction for that period against that period's Bank Rec that has already been conducted. Thanks! childofthe1980s what KB are you referin...

Excel automatically does undo on my worksheet
When entering data on an Excel 2003 worksheet, when I pause the system does an undo, and sometimes several levels of undo. I know it is an undo as I can hit redo and get the data back. The only way I can stop this is to save after every edit. Is there a way to stop this automatic undo? I've noticed it in Internet Exporer too. Timx1969 wrote: > When entering data on an Excel 2003 worksheet, when I pause the system does > an undo, and sometimes several levels of undo. I know it is an undo as I can > hit redo and get the data back. The only way I can stop this is to save aft...

undo sorts button
I have a form with a subform that is displayed in datasheet view. When I right click to sort on a column I get A-Z and Z-A options but there is no clear all sorts option so I would like to add a button to clear all sorts. The button is in the detail section beside the subform. The subform name is called [subEditParts]. Can someone help with this, Thanks Wally On Tue, 11 May 2010 07:00:01 -0700, wallymeister <wallymeister@discussions.microsoft.com> wrote: Me.subEditParts.Form.OrderBy = "" Me.subEditParts.Form.OrderByOn = False -Tom. Microsoft Ac...

Undo Command
I have a form with an embedded subform. On the main form, I have a cancel button that performs ME.Undo. I would like to get it to also Undo the entries on the subform but cannot get it to work. Any ideas?? "Bumbino" <Bumbino@discussions.microsoft.com> wrote in message news:ADA86E21-2502-4A78-B3D7-5B3DF02F90BC@microsoft.com... >I have a form with an embedded subform. On the main form, I have a cancel > button that performs ME.Undo. I would like to get it to also Undo the > entries on the subform but cannot get it to work. Any ideas?? Me.SubformControlName.For...

multilevel undo redo
Dear all, i am very much confused that what is the best way to implement multilevel undo redo?? i have mdi application in which my view contains rich edit control. the rich edit control is my class that is directly derived from CRichEditCtrl. class CMyRichEdit : public CRichEditCtrl { }; class AppView : public CView { CMyRichEdit m_rich; } in this class firstly i implemented the undo with rich edit API's like CanUndo() but then i got sucess to implement single level undo. and now i want to implement multilevel undo / redo. please give me some advice if anyone have done it in t...

No Undo after save
I have searched forums and web sites all over the internet for the answer to why excel does not allow you to undo after a save. I have built a habit over the years of hitting ctrl-s very often in whatever i am working in. for any application other than excel this isn't a problem. What good is it to have this feature? What kind of evil genious thought up this great idea? Is clearing the undo freeing up memory? Well guess what, we all have more than 64 megs of RAM now. So does anyone know of some hack or registry edit that will allow for excel to undo after a save? Or am I alone in thinkin...

Undo "undo"?
Hi all Is there a VBA instruction to reverse the effect of Application.Undo? I wish to achieve the following effect: If I change any values in Worksheet("Codes").Range("Short_name_range") then those changes must be reflected by identical changes in Worksheet("Analysis").Range("Account_1_Range") and in Worksheet("Analysis").Range("Account_2_Range") wherever there is a match between the original values. For various reasons I cannot link these cells by formulae and I therefore have to make the changes by an event handler. Code follows...

undo
It happened all of a sudden: when I type something in a cell and move to another cell, the undo button greys and the undo function is therefore disabled. It never happened before, and I have no recollection of having modified settings. in this regard I could not find any setting to enable/disable the undo-redo buttons. can please somebody help/ thanks Have you got some macro running? Mostropovich wrote: > It happened all of a sudden: > when I type something in a cell and move to another cell, the undo button > greys and the undo function is therefore disabled. > It never hap...

How do I change the undo limit in Publisher?
Many thanks for an answer. I don't know if it can be done. My experience is that it will allow you to undo all the way back to the last save. (Publisher 2000) -- Don Vancouver, USA "Troy Filipek" <Troy Filipek@discussions.microsoft.com> wrote in message news:C46822D6-26EC-4D29-8DD6-4358D32D9E4A@microsoft.com... > Many thanks for an answer. I see. Not very convenient, is it? You would think that if an entry-level graphic software like Paint Shop would allow unlimited "undos" then something like Publisher 2007 should have it with no questions aske...