Prev: Command Button to open a password protected excel spreadsheet
Next: Zooming in on a picture on a form
From: Peter Stone on 22 Feb 2010 14:15 Novice, Access 2003, XP I want to pass a control name to another application. The control is on a subform, but I don't know the name of the main form because the subform is in various mainforms. E.g. fsubTxt contains txtBox1. How do I find the name of frmMain and then pass the frmMain!fsubTxt.Form!txtBox1 Thank you
From: Jeanette Cunningham on 22 Feb 2010 15:09 You can get the main form's name by using Screen.ActiveForm.Name Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia "Peter Stone" <PeterStone(a)discussions.microsoft.com> wrote in message news:20BA9DE7-0107-46CB-96F8-5917C348BB25(a)microsoft.com... > Novice, Access 2003, XP > > I want to pass a control name to another application. The control is on a > subform, but I don't know the name of the main form because the subform is > in > various mainforms. > > E.g. fsubTxt contains txtBox1. How do I find the name of frmMain and then > pass the frmMain!fsubTxt.Form!txtBox1 > > Thank you
From: Daryl S on 22 Feb 2010 15:11 Peter - You can reference the parent's name as follows: [Parent].[Name] -- Daryl S "Peter Stone" wrote: > Novice, Access 2003, XP > > I want to pass a control name to another application. The control is on a > subform, but I don't know the name of the main form because the subform is in > various mainforms. > > E.g. fsubTxt contains txtBox1. How do I find the name of frmMain and then > pass the frmMain!fsubTxt.Form!txtBox1 > > Thank you
From: Peter Stone on 22 Feb 2010 19:59 Thank you Just what I needed. Can I pass a reference to the control like this? Screen.ActiveForm.Name!fsubTxt1.Form!txtPub
From: Daryl S on 23 Feb 2010 09:27 Peter - I haven't needed to try this, but I think you can declare an object variable and then set the object to be the control you want. Dim objControl as object objControl = Screen.ActiveForm.Name!fsubTxt1.Form!txtPub Then you can pass the object. Someone else may have done this? -- Daryl S "Peter Stone" wrote: > Thank you > > Just what I needed. > > Can I pass a reference to the control like this? > > Screen.ActiveForm.Name!fsubTxt1.Form!txtPub
|
Next
|
Last
Pages: 1 2 Prev: Command Button to open a password protected excel spreadsheet Next: Zooming in on a picture on a form |