| re: Build a reference to a control on the fly
I'll try that, but in the meantime, what is the variable type of the variable
gAcCtlStuffResultInto
??
Thanks
"Malcolm Cook" <mec@stowers-institute.org> wrote in message news:<6noVc.81$i_4.432@news.more.net>...[color=blue]
> before opening frmB, set a global variable, as follows
>
> set gAcCtlStuffResultInto = Screen.ActiveForm.ActiveControl
>
> then, in frmB, use the following
>
> gAcCtlStuffResultInto.value = me.ID
>
>
>
>
> "Rob" <sindle@ensco.com> wrote in message
> news:bd910ee.0408200633.3c06fe6@posting.google.com ...[color=green]
> > THere must be an easy way to do the following, but I'm drawing a
> > blank.
> >
> > I have 2 forms frmA and frmB. I double click on a text box in frmA
> > and open frmB. In frmB, I select an item and close. On the close
> > button I stuff the selected value back into the text box on frmA via.
> > I need to make frmB generic so it can stuff its value back into the
> > same type of text box on MANY different forms in my app. I pass in
> > the name of the calling form via OpenArgs tp frmB.
> >
> > This works fine in frmB when frmA is not a subform:
> >
> > Forms(Me.OpenArgs).ActiveControl.Value = me.ID
> >
> > But I need to be able to do this from a subform.
> > When sfrmA is a subform, I can't figure out a way to let frmB find the
> > control on subform sfrmA to stuff the value into:
> >
> > Hardcoded, this works fine:
> >
> > Forms!mfrmA!sfrmA.Form!myID = Me.ID
> >
> > But I can't find a way to pass in (essentially) this string
> > "Forms!mfrmA!sfrmA.Form!myID" and Assign Me.ID to it generically.
> >
> > Any help would be greatly appreciated!!
> > Thanks,
> > Rob[/color][/color] |