Nov 7, 2007 #1 MalekTaus Programmer Nov 5, 2007 10 US I am trying to create a sub procedure for cancel buttons across several forms. The problem is that I need to be able to pass the form object to the procedure in order to unload the form. Can anyone help?
I am trying to create a sub procedure for cancel buttons across several forms. The problem is that I need to be able to pass the form object to the procedure in order to unload the form. Can anyone help?
Nov 7, 2007 1 #2 S SkipVought Programmer Dec 4, 2001 47,492 US Hi, Check out the Forms collection. Skip, When a diminutive clarvoyant had disappeared from detention, headlines read... Small Medium at Large Upvote 0 Downvote
Hi, Check out the Forms collection. Skip, When a diminutive clarvoyant had disappeared from detention, headlines read... Small Medium at Large
Nov 7, 2007 Thread starter #3 MalekTaus Programmer Nov 5, 2007 10 US It was UserForm that I needed. Thanks for the help and here is my oh so simple solution Code: Private Sub btnCancel_Click() Call cancelButton(Me) End Sub Code: Sub cancelButton(frm As UserForm) Unload frm End Sub Upvote 0 Downvote
It was UserForm that I needed. Thanks for the help and here is my oh so simple solution Code: Private Sub btnCancel_Click() Call cancelButton(Me) End Sub Code: Sub cancelButton(frm As UserForm) Unload frm End Sub
Nov 8, 2007 #4 cresbydotcom Technical User May 22, 2006 234 Form1.Show & Form1.Hide work for me - that way I can set values before it is visible. Or use the Activate/deactivate events to set things up. Upvote 0 Downvote
Form1.Show & Form1.Hide work for me - that way I can set values before it is visible. Or use the Activate/deactivate events to set things up.
Nov 8, 2007 #5 combo Technical User Jan 1, 2003 4,189 PL As long as you do not want to interact with the form you try to close, without calling external procedure: Code: Private Sub btnCancel_Click() Unload Me End Sub combo Upvote 0 Downvote
As long as you do not want to interact with the form you try to close, without calling external procedure: Code: Private Sub btnCancel_Click() Unload Me End Sub combo