Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2012
    Posts
    31

    Unanswered: Problem in Undo event

    Guys how to code the undo event in subform..

    ex:
    My main form is LockerEdit
    Subform of LockerEdit form is LockEmpStatus
    Sub form of LockEmpStatus form is QLockerOccupants

    Now my cancel button is in the QLockerOccupants form so i need to cancel the data located in the LockEmpStatus form. How i can do that? I tried already the Docmd****nCommand acCmdUndo and Me.Undo but it doesn't work..

    Any reply would be much appreciated.
    Tnx in advance.God Bless...

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Me.<Something> is a reference to the current (or active) form, i.e. QLockerOccupants in your example. To reference the parent form of a subform, you can use Me.Parent.<Something> (LockEmpStatus in your example), and to reference the parent of the parent (LockerEdit in your example) you can use Me.Parent.Parent.<Something>.
    Have a nice day!

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Quote Originally Posted by djrods View Post

    ...Sub form of LockEmpStatus form is QLockerOccupants...

    ...my cancel button is in the QLockerOccupants form so i need to cancel the data located in the LockEmpStatus form...
    Proper referencing aside, there can be no 'canceling' or 'undoing' of data from LockEmpStatus using a Command Button on its Subform, QLockerOccupants! The very act of moving from LockEmpStatus to QLockerOccupants causes the data in LockEmpStatus to be saved. At this point, you'd have to have a way to identify the appropriate Record, in LockEmpStatus, and delete it.

    Linq '0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Join Date
    Dec 2012
    Posts
    31
    Tnx a lot to those who replied my post...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •