Closing Form from Subform

cjmitton

Registered User.
Local time
Today, 16:08
Joined
Mar 25, 2011
Messages
70
In my Main form (frm_Matters) I have a subform (frm_Others) in that form I have a button which opens a new pop up form (frm_Other_Business) but I then need to close the form that it came from (I.e the Parent form 'Matters').

I've used the code I usually use when opening / closing forms but as I'm running this from a subform (I'm guessing) its trying to close the subform instead of the parent so I tried the following but still not luck.

Code:
DoCmd.Close acForm, Form!frm_Matters, acSaveNo

Any thoughts please?
 
Something like:
Code:
DoCmd.OpenForm "FormName"... etc
DoCmd.Close acForm [COLOR=red]Me.Parent.Name[/COLOR], acSaveNo
Leave the bit in red as it is.
 
Excellent, thanks for that. I thought I would have to be more specific!
 
You're welcome!

Na, as long as you call the parent form it will be fine.
 

Users who are viewing this thread

Back
Top Bottom