I have a pop-up form in my database with a "cancel" button on it. The cancel button's OnClick event runs the following code to close the form:
DoCmd.Close acForm, "frmSearchSupplier", acSaveNo
The problem is, when the form closes, the Access application itself loses focus, so if another program like Word or Excel is open in the background it shows up on the screen. I have plenty of pop-up forms that use the DoCmd.Close method and I have not experienced this problem before, so I'm not sure what is going on with this one.
Any suggestions would be much appreciated.
Thanks.