Programmatically close a modal popup form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a command button on a form that popsup another form (set to modal).
I would like the form to close when the keyer leaves the last field on the
form instead of cycling back through the fields. The regular doCmd.Close or
doCmd.RunCommand gives me an error that this "the command cannot be carried
out while processing a form or report."

Any suggestions appreciated.

Thanks
Bonnie
 
Have you tried making a new control and setting it as the last in the
tab order. Set everything about the control to invisible/transparent.
Make sure the control is unbound. In the control's gotfocus event, do
the close.

Hope that helps,
~J
 
Back
Top