Close Popup

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

Guest

I am trying to close a popup with a control button that takes one to another
form. On exiting the popup, I want it to close. I've tried macros and event
procedure, but nothing seems to work. I also posted the question a few days
ago but can not find it now on the site. So son't be surprised if you've hear
the question before.
 
The Popup property doesn't affect the way a form closes. You can still use
the same code:

DoCmd.OpenForm "Form To Open"
DoCmd.Close acForm, "Form To Close"

If you use it like it is above in a standard function, you can use it
anywhere, even on a modal form:

Public Function OpenClose(strFormToOpen As String, strFormToClose As String)

On Error Resume Next
DoCmd.OpenForm strFormToOpen
DoCmd.Close acForm, strFormToClose

End Function

Then just add the forming to a command button's Click property:

=OpenClose("Form2","Form1")
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top