Referencing a textbox from outside a Navigation Menu

sbrown106

Member
Local time
Today, 23:21
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!
 
Check out this link for the correct syntax for referencing forms, Subforms their controls and properties from various relative location.
 
you can reference anything using the full path:
forms!fMyForm!txtbox
 
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

Back
Top Bottom