Referencing a textbox from outside a Navigation Menu (1 Viewer)

sbrown106

Member
Local time
Today, 19:32
Joined
Feb 6, 2021
Messages
77
Hi, if somebody could give some advice with this please Ive been going around in circles with it

If I have a form called Form1 within a Navigation Form called frmNavigation (so the menu tab on the nav form will read Form1)

if I have a text box that sits above and outside the navigation menu say 'text2' (within frmNavigation).

How do I reference text2 (text box) from text1 (text box) within Form1

I know I can reference a text box within a form by Me!txt.name = "whatever", but getting confused with the Navigation subforms. I am trying to trigger text2 based on an event in text1 (for example text2 will change colour when text1 is selected)

thanks for any help!
 

LanaR

Member
Local time
Tomorrow, 04:32
Joined
May 20, 2021
Messages
113
Check out this link for the correct syntax for referencing forms, Subforms their controls and properties from various relative location.
 

Ranman256

Well-known member
Local time
Today, 14:32
Joined
Apr 9, 2015
Messages
4,337
you can reference anything using the full path:
forms!fMyForm!txtbox
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 02:32
Joined
May 7, 2009
Messages
19,230
Text1 is in Form1 (subform).
Text2 in Navigation Form.

Text1 need to Reference Text2 when Text1 is selected:

private sub Text1_GotFocus()
Me.Parent!Text2.BackColor = vbYellow
end sub
 

Users who are viewing this thread

Top Bottom