Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Brugge, Belgium
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Canceling a cmdNew procedure (MS access 2007)

    To enter and display orders, i have a mainform "frmOrders" and a subform "sfmOrderdetails". The recordsource of this form is such, that by opening for the first time, only the header of the mainform is displayed.
    In this header i have a textbox "GoToOrder" and several commandbuttons, e.g. "CmdNew" , "CmdCancel" and "CmdClose".
    When a valid Ordernumber is entered in the textbox "GoToOrder", the data of the relevant order is displayed.
    Now suppose that the data of such an order is displayed on the form, and that i click , without being my intension, on the commandbutton "CmdNew".
    As a consequence, the displayed data dissapear and the form get into a dataentry state.
    Because it is'nt my intension to enter a new order, i like to have the possiblity to cancel this situation, and go back to the situation, where i can enter the same or another ordernumber in the textbox "GoToOrder".
    putting the command DoCmd.Runcommand acCmdUndo in the click event of the commandbutton "CmdCancel", doesn't work because nothing has been entered, so there is nothing to undo. What's the alternative to get out of this situation?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Canceling a cmdNew procedure (MS access 2007)

    Why can't the user enter an order number in the GoToOrder text box?

  3. #3
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Brugge, Belgium
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Canceling a cmdNew procedure (MS access 2007)

    When the form is in dataentry mode, the textbox isn't enabled, because i thought that while a form is in dataentry mode, no browsing to a booked order is possible.
    I will by means of experiment make the textbox enable and try to fill in in a ordernumber, while the form is in dataentry mode.
    I let you know the result of this test. Thanks for the hint

  4. #4
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Brugge, Belgium
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Canceling a cmdNew procedure (MS access 2007)

    I can tell you that your hint solved my problem. I enabled the textbox and all works fine. Thank you

Posting Permissions

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