Hi all,
I have a form in which you type in a parameter, then I have a button which produces a report based on the parameter, and then closes the form. Everything works fine, and I have the code in the click event of the button. Although not totally necessary, I'd like to have it in the enter event of the button so that the code executes when the user hits the enter key. BUT, when I do this, I get an error on the code Docmd.Close acForm, "BuilderSearch", acSaveNo with the error saying This action can't be carried out while processing a form or report event. I get this message if I put the close statement anywhere by the click event. Like I said, it's not a huge deal, but does anyone have any suggestions on how I can have the form close after the report runs? Thanks.
-Jeff
I have a form in which you type in a parameter, then I have a button which produces a report based on the parameter, and then closes the form. Everything works fine, and I have the code in the click event of the button. Although not totally necessary, I'd like to have it in the enter event of the button so that the code executes when the user hits the enter key. BUT, when I do this, I get an error on the code Docmd.Close acForm, "BuilderSearch", acSaveNo with the error saying This action can't be carried out while processing a form or report event. I get this message if I put the close statement anywhere by the click event. Like I said, it's not a huge deal, but does anyone have any suggestions on how I can have the form close after the report runs? Thanks.
-Jeff