[AccessD] Cannot close a form with Docmd.Close

Bill Benson (vbacreations) vbacreations at gmail.com
Mon May 24 16:06:11 CDT 2010


I am trying to close a form. A lot was done on this form before I get to the
line to close it, but I am being told "The close action was canceled".

I later added a whole bunch of cleanup lines, and it went through everything
and DID close immediately after I added these lines. Then I thought, well
why not test them one by one to see which helped. So I turned them all off
one at a time and found none helped. Thinking I was going insane, I added
all the lines back and the form wouldn't close. Can someone tell me what
might be going on without looking at all the code? Nothing I know of could
be clinging to the form. Debug.Print Forms.count = 1. The form was opened
with this line:

DoCmd.OpenForm MyTemplate, acDesign, , , acFormEdit, acHidden


TIA!

Set T = Nothing
Set D = Nothing
Set R = Nothing
Set Prp = Nothing
Set Lbl = Nothing
Set LastControl = Nothing
Set Txt = Nothing
Set Ctl = Nothing
Set Frm = Nothing
Set F = Nothing
ReDim VarOriginalControls(0)
ReDim ArSkip(0)

DoCmd.Close acForm, FrmName, acSaveYes




More information about the AccessD mailing list