opening and closing a popup form

P

Patrick

hi all,

i have had a look for the answer to this, and I have tried several
things but i think i am still doing something wrong.

I would like to achieve the same affect as when you go to
tools/options, where a form opens, gives you options, and you can
either press ok or cancel.

i can get the form to open when you click on a button on a separate
form, but i cant get the options form to close.

could someone help me out with this?

thanks

Patrick
 
A

Allen Browne

Your popup form has a Cancel button that you want to close the form?

Try this as the event procedure for your command button:
Private Sub cmdClose_Click()
DoCmd.Close acForm, Me.Name
End Sub
 
K

Keith Wilby

Patrick said:
hi all,

i have had a look for the answer to this, and I have tried several
things but i think i am still doing something wrong.

I would like to achieve the same affect as when you go to
tools/options, where a form opens, gives you options, and you can
either press ok or cancel.

i can get the form to open when you click on a button on a separate
form, but i cant get the options form to close.
I don't understand - is there a close button ("x" in the top right corner)?
If not then open the form in design mode and set the "close button" property
to "yes".

Keith.
www.keithwilby.com
 
P

Patrick

Thanks Allen, that has worked great. Weird thing is that I tried that
code before, and it didn't work. i tried it all again and now it
does...

oh well, i guess that's programming!

thanks for your help
 
Top