MS Access cannot Undo

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jamesnkk
    New Member
    • Nov 2006
    • 134

    MS Access cannot Undo

    I have a list box which show all the Supplier PO Numbers, on the Right of the list box there is a command button called "Add", If user click the "Add' Button it will create a new PO

    DoCmd.OpenForm "frmPO", , , stLinkCriteria, acFormAdd

    In the New PO Form, If user decide to undo, user click the Undo button

    me.undo

    It seem like it cannot be undo, so I issue a delete and undo the current record , this time no complain from Ms Access,

    DoCmd.DoMenuIte m acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuIte m acFormBar, acEditMenu, 6, , acMenuVer70
    Me.Undo
    DoCmd.Close

    But when I return to the listbox, another new PO number was auto created.
    What wrong with it ? Iwhich is the better or correct method.

    Please Advise
  • PEB
    Recognized Expert Top Contributor
    • Aug 2006
    • 1418

    #2
    Hi,

    Your PO number is it an autonumber, or it is a number that u introduces using append query?

    In fact DoCmd.OpenForm "frmPO", , , stLinkCriteria, acFormAdd oppens a new form that is ready for adding information.... I don't see how it is inserted automatically the information about your PO number? It should be introduced automatically or taped manually?

    If it is an auto number your PO so there is no Undo command that can restore the previous autonumber!

    For more help, can u describe how do u introduce your PO number /auto generation, or user have to introduce it/?
    If it is the introduction of This PO number you can do it using a field from your current form without opening a new form destinated to this introduction! Only using an append query!

    Marry Cristmas!

    Originally posted by jamesnkk
    I have a list box which show all the Supplier PO Numbers, on the Right of the list box there is a command button called "Add", If user click the "Add' Button it will create a new PO

    DoCmd.OpenForm "frmPO", , , stLinkCriteria, acFormAdd

    In the New PO Form, If user decide to undo, user click the Undo button

    me.undo

    It seem like it cannot be undo, so I issue a delete and undo the current record , this time no complain from Ms Access,

    DoCmd.DoMenuIte m acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuIte m acFormBar, acEditMenu, 6, , acMenuVer70
    Me.Undo
    DoCmd.Close

    But when I return to the listbox, another new PO number was auto created.
    What wrong with it ? Iwhich is the better or correct method.

    Please Advise

    Comment

    • jamesnkk
      New Member
      • Nov 2006
      • 134

      #3
      Originally posted by PEB
      Hi,

      Your PO number is it an autonumber, or it is a number that u introduces using append query?

      In fact DoCmd.OpenForm "frmPO", , , stLinkCriteria, acFormAdd oppens a new form that is ready for adding information.... I don't see how it is inserted automatically the information about your PO number? It should be introduced automatically or taped manually?

      If it is an auto number your PO so there is no Undo command that can restore the previous autonumber!

      For more help, can u describe how do u introduce your PO number /auto generation, or user have to introduce it/?
      If it is the introduction of This PO number you can do it using a field from your current form without opening a new form destinated to this introduction! Only using an append query!

      Marry Cristmas!

      Hi Merry Christmas to you, The PO is an auto number, so what should I do to overcome this problem, please help

      Comment

      • jamesnkk
        New Member
        • Nov 2006
        • 134

        #4
        Originally posted by PEB
        Hi,

        Your PO number is it an autonumber, or it is a number that u introduces using append query?

        In fact DoCmd.OpenForm "frmPO", , , stLinkCriteria, acFormAdd oppens a new form that is ready for adding information.... I don't see how it is inserted automatically the information about your PO number? It should be introduced automatically or taped manually?

        If it is an auto number your PO so there is no Undo command that can restore the previous autonumber!

        For more help, can u describe how do u introduce your PO number /auto generation, or user have to introduce it/?
        If it is the introduction of This PO number you can do it using a field from your current form without opening a new form destinated to this introduction! Only using an append query!

        Marry Cristmas!
        It is an auto number, when user click the Add button, it will open up the PO form, (I did not use Query Append), if user enter information in the form, the PO number example 100 will be show, next user click the undo button, so the form is close, to my surprise the listbox that show all PO have generated a PO 101 with blank information.

        Comment

        • MMcCarthy
          Recognized Expert MVP
          • Aug 2006
          • 14387

          #5
          Originally posted by jamesnkk
          It is an auto number, when user click the Add button, it will open up the PO form, (I did not use Query Append), if user enter information in the form, the PO number example 100 will be show, next user click the undo button, so the form is close, to my surprise the listbox that show all PO have generated a PO 101 with blank information.
          Set one of the other fields to required and the record will not be saved.

          Mary

          Comment

          Working...