docmd.close acForm ignored

  • Thread starter Thread starter Joe M.
  • Start date Start date
J

Joe M.

I have a form with a cmd button that has the code
DoCmd.Close acForm, "Hours_Flexible_Query": MsgBox "Stop"
The code is ignored and the form does not close. The msgbox executes. On
another form the identical type code exists and works. Why is this happening?
Can someone help?

Thanks,
Joe M.
 
Joe M. said:
I have a form with a cmd button that has the code
DoCmd.Close acForm, "Hours_Flexible_Query": MsgBox "Stop"
The code is ignored and the form does not close. The msgbox executes. On
another form the identical type code exists and works. Why is this
happening?
Can someone help?


I would double-check the name of the form, and make sure (because of the
name) that you're trying to close a form, not a query. DoCmd.Close won't
throw an error if the object you're trying to close isn't open, so if you
misspell the form name, nothing will happen.
 
Unbelievable! I must checked this 3 or 4 times! But that was the problem.
Thanks for the info!
 
Back
Top