Closing a form after it loses the focus

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

Guest

Hi all

I have a DateRange form that has 2 text boxes and 2 command buttons. The text boxes are to receive start and end dates and the buttons are 1) to open a print preview or 2) to close the DateRange form (i.e. to cancel)

When button 1 is pushed, the preview is launched as desired. I would also like to close the DateRange form when button 1 is pushed, since it is no longer required. I tried the DoCmd.Close within button 1 event code but I can't find the right place to put it

Any suggestions would be appreciated

Cheers
Jody
 
Put the close code after the open form code, and use this form to make sure
the code is easily readable:

DoCmd.Close acForm, "The name of the form to close"
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

Jody said:
Hi all,

I have a DateRange form that has 2 text boxes and 2 command buttons. The
text boxes are to receive start and end dates and the buttons are 1) to open
a print preview or 2) to close the DateRange form (i.e. to cancel).
When button 1 is pushed, the preview is launched as desired. I would also
like to close the DateRange form when button 1 is pushed, since it is no
longer required. I tried the DoCmd.Close within button 1 event code but I
can't find the right place to put it.
 
worked like a charm! Thanks Arvin

Jod

----- Arvin Meyer wrote: ----

Put the close code after the open form code, and use this form to make sur
the code is easily readable

DoCmd.Close acForm, "The name of the form to close
--
Arvin Meyer, MCP, MV
Microsoft Acces
Free Access downloads
http://www.datastrat.co
http://www.mvps.org/acces

Jody said:
text boxes are to receive start and end dates and the buttons are 1) to ope
a print preview or 2) to close the DateRange form (i.e. to cancel)like to close the DateRange form when button 1 is pushed, since it is n
longer required. I tried the DoCmd.Close within button 1 event code but
can't find the right place to put it
 
Back
Top