Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2013
    Posts
    2

    Smile Unanswered: This action can't be carried out while processing a form or report event.

    Hello,
    I am trying to put the command: DoCmd.Close acForm, "AppointmentF", acCloseSaveYes in the lostfocus event in a textbox on my form AppointmentF. The plan is to have the form automatically close and save if the user tries to tab past this textbox. It is the bottom of the tab order in the form and I don't want them to be able to automatically create a new record if they simply keep tabbing and do not close the form. In the same event I also have Forms!MonthlyCalendarF!.SetFocus which is to set focus back to the main form MonthlyCalendarF. When I try this out and I tab out of the textbox I get the error message: This action can't be carried out while processing a form or report event. I cannot figure out why this is happening. Any help would be greatly appreciated.

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    If your goal is to simply prevent them from being able to automatically create a new record if they simply keep tabbing, go into the Form's Properties Pane and go to the 'Other' Tab and set the Cycle Property to 'Current Record.' If they Tab out of the last Control they'll simply go back to the first Control on the Form.

    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

  3. #3
    Join Date
    Sep 2013
    Posts
    2

    thanks for the tip

    Quote Originally Posted by Missinglinq View Post
    If your goal is to simply prevent them from being able to automatically create a new record if they simply keep tabbing, go into the Form's Properties Pane and go to the 'Other' Tab and set the Cycle Property to 'Current Record.' If they Tab out of the last Control they'll simply go back to the first Control on the Form.

    Linq ;0)>
    Thanks for your help Missinglinq. I set the cycle property to current page instead so that it is still possible to edit the current record while in it but the user can't inadvertently create a new record by tabbing too far. I also put a message box in the last field reminding the user to click to close and return back to the main form. I still would like to know why I could not get doCmd.Close to work in any event except onclick but this solution will work in this case. Thank you again.

Tags for this Thread

Posting Permissions

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