Reference a subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I've made a generic form to allow text in a textbox on any form to be
'zoomed' to a bigger textbox on a popup form. When the zoom form closes it
updates the textbox control on the original form using:

Set frmNameofForm = Forms(strNameofForm)
frmNameofForm.[txbLetter] = Me.txbLetterZoom

However, how do I do this when the control is on a subform?

And, is this called explicit or implicit referencing, or something else -
just so I can refer to it in the future.

Many thanks
Leonard
 
You can pop up the built-in zoombox by pressing Shift+F2.

Alternatively, you could put a command button beside your text box, and put
this into its Click event procedure:
Me.[NameOfYourTextboxHere].SetFocus
RunCommand acCmdZoomBox
 
Hi Allen

Thanks for the message. I've used the shift+f2 tool and it works well, but I
wanted to customise my own zoom form.

Any thoughts on the subform referencing?

Leonard


Allen Browne said:
You can pop up the built-in zoombox by pressing Shift+F2.

Alternatively, you could put a command button beside your text box, and put
this into its Click event procedure:
Me.[NameOfYourTextboxHere].SetFocus
RunCommand acCmdZoomBox

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Leonard said:
Hi
I've made a generic form to allow text in a textbox on any form to be
'zoomed' to a bigger textbox on a popup form. When the zoom form closes it
updates the textbox control on the original form using:

Set frmNameofForm = Forms(strNameofForm)
frmNameofForm.[txbLetter] = Me.txbLetterZoom

However, how do I do this when the control is on a subform?

And, is this called explicit or implicit referencing, or something else -
just so I can refer to it in the future.

Many thanks
Leonard
 
Where did your variable strNameofForm come from?
Could you pass a reference to the form itself, instead of the name of your
form?

Example, create your function like this:
Public Function RunMyZoomBox(frm As Form)
and then call it like this:
Call RunMyZoomBox(Me)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Leonard said:
Hi Allen

Thanks for the message. I've used the shift+f2 tool and it works well, but
I
wanted to customise my own zoom form.

Any thoughts on the subform referencing?

Leonard


Allen Browne said:
You can pop up the built-in zoombox by pressing Shift+F2.

Alternatively, you could put a command button beside your text box, and
put
this into its Click event procedure:
Me.[NameOfYourTextboxHere].SetFocus
RunCommand acCmdZoomBox


Leonard said:
Hi
I've made a generic form to allow text in a textbox on any form to be
'zoomed' to a bigger textbox on a popup form. When the zoom form closes
it
updates the textbox control on the original form using:

Set frmNameofForm = Forms(strNameofForm)
frmNameofForm.[txbLetter] = Me.txbLetterZoom

However, how do I do this when the control is on a subform?

And, is this called explicit or implicit referencing, or something
else -
just so I can refer to it in the future.

Many thanks
Leonard
 
let's try that again

[Forms]![_mainFormName].form![_subformName]![_controlName]

Thought I'd make that a bit more clearer that [Forms] & .form are
literals. Replace the _mainFormName, _subformName and _controlName as
appropriate.
 
Why not simply pass it the name of the control also I suspect it may be
simpler to bring the zoom box up as as a dialog using a function, hide it on
close, retrieve the results, reset the focus and then close it. If you write
a generic function then you can call it from any forms module thus or have a
generic routine attached to a key(s) that could work anywhere if you caeeld
it with screen.activeform.activecontrol

rgds
stephen

Allen Browne said:
Where did your variable strNameofForm come from?
Could you pass a reference to the form itself, instead of the name of your
form?

Example, create your function like this:
Public Function RunMyZoomBox(frm As Form)
and then call it like this:
Call RunMyZoomBox(Me)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Leonard said:
Hi Allen

Thanks for the message. I've used the shift+f2 tool and it works well,
but I
wanted to customise my own zoom form.

Any thoughts on the subform referencing?

Leonard


Allen Browne said:
You can pop up the built-in zoombox by pressing Shift+F2.

Alternatively, you could put a command button beside your text box, and
put
this into its Click event procedure:
Me.[NameOfYourTextboxHere].SetFocus
RunCommand acCmdZoomBox


Hi
I've made a generic form to allow text in a textbox on any form to be
'zoomed' to a bigger textbox on a popup form. When the zoom form
closes it
updates the textbox control on the original form using:

Set frmNameofForm = Forms(strNameofForm)
frmNameofForm.[txbLetter] = Me.txbLetterZoom

However, how do I do this when the control is on a subform?

And, is this called explicit or implicit referencing, or something
else -
just so I can refer to it in the future.

Many thanks
Leonard
 
Back
Top