Suddenly can't close form with DoCmd.Close
Posted on 2009-02-15
I have a login form that opens a main form when the user has identified him/herself. My login form was very simple, just a list of users in a combobox, user would click on his/her name in the list, and on the combobox click event, I would open the main form, and close the login form with DoCmd.Close acForm, <login form name>, acSaveno
I now added in the login form the entry of a password in a textbox, and, on the Exit event processing of the password text box, I compare the entered pw with the pw in the DB, and if the password is OK, I open the main form and close the login form with the same DoCmd's as above.
However, this DoCmd.Close now refuses to work and gives me an error "This action can't be carried out while processing a form or report event".
I don't see any damn difference between the previous click event on the user list combobox and an Exit event on the password text box. Both are events. Why does the close work on the first event, and not on the second one ?
How can I close that login window now ??
Thanks for help.