[AccessD] Closing a Form using VBA

Steve Schapel miscellany at mvps.org
Wed May 14 14:33:08 CDT 2008


Darren,

As mentioned in my earlier reply, the way to explicitly reference the 
form from which the code is being called, as is the case with Darryl's 
example, is:
DoCmd.Close acForm, Me.Name

Regards
Steve

Darren D wrote:
> Hi Darryl
> 
> Explicitly name the form you wanna close or it will close the one in the line
> above the close command
> 
> EG
> Call OpenTL_Form
> DoCmd.Close  ' <-- Doing this closes the form just opened, and leaves me with
> the original 
> 
> Will just close OpenTL_Form
> 
> 
> Needs to be
> 
> Call OpenTL_Form
> DoCmd.Close acForm, "SomeCoolFormNamehere"
> 



More information about the AccessD mailing list