Hello all,
I'm trying to reference the name of my subform or form off of my popup. I'm doing this because I want to use it as a referencing point to requery the subform after I add my record on the popup form.
Forms![fpop_Location_Active_Circuits_Lines]![fsub_Active_Circuits_Lines].requery
I know I could place that exact code in my close event but I'm using this popup form off of multiple subforms and that form name could change. So when the times comes to requery that particular subform I don't know which one I should be requering.
Here is the open code I started to use on my popup form:
Dim ctlPrevious As Control
Set ctlPrevious = Screen.PreviousControl
Select Case ctlPrevious.Name
Case "Forms![fpop_Location_Active_Circuits_Lines]![fsub_Active_Circuits_Lines]"
'Declares Form Dim
MasterForm = "Forms![fpop_Location_Active_Circuits_Lines]![fsub_Active_Circuits_Lines]"
End Select
In my close event I could do this
MasterForm.requery
The problem with the PreviousControl is that on the subform I can't get it to setfocus to the subform's name. Even with these commands:
Forms![fpop_Location_Active_Circuits_Lines]![fsub_Active_Circuits_Lines].SetFocus
DoCmd.OpenForm "fpop_Admin_Circuit_Line"
Is there a way to pass on the PreviousControl name of the subform or is there a way to see if a particular form is open so I could test that for the requery.
Let me know if there is anything out there that could do this.
Thanks!!
I'm trying to reference the name of my subform or form off of my popup. I'm doing this because I want to use it as a referencing point to requery the subform after I add my record on the popup form.
Forms![fpop_Location_Active_Circuits_Lines]![fsub_Active_Circuits_Lines].requery
I know I could place that exact code in my close event but I'm using this popup form off of multiple subforms and that form name could change. So when the times comes to requery that particular subform I don't know which one I should be requering.
Here is the open code I started to use on my popup form:
Dim ctlPrevious As Control
Set ctlPrevious = Screen.PreviousControl
Select Case ctlPrevious.Name
Case "Forms![fpop_Location_Active_Circuits_Lines]![fsub_Active_Circuits_Lines]"
'Declares Form Dim
MasterForm = "Forms![fpop_Location_Active_Circuits_Lines]![fsub_Active_Circuits_Lines]"
End Select
In my close event I could do this
MasterForm.requery
The problem with the PreviousControl is that on the subform I can't get it to setfocus to the subform's name. Even with these commands:
Forms![fpop_Location_Active_Circuits_Lines]![fsub_Active_Circuits_Lines].SetFocus
DoCmd.OpenForm "fpop_Admin_Circuit_Line"
Is there a way to pass on the PreviousControl name of the subform or is there a way to see if a particular form is open so I could test that for the requery.
Let me know if there is anything out there that could do this.
Thanks!!