Forms and Subforms Aren't Communicating

G

Guest

Hello

I have a main form with 2 subforms. On the main form is a text box. I am trying to change the text in the text box when a certain event occurs in subform1. The text in the textbox will need to be accessed from subform2. So I am trying to program a line of code where subform1 recognizes subform2, gets the text, and puts it in the text box. I have tried a variety of ways including trying to call a functoin on the main form like this from subform1:
Call Forms!MainFormName.TheFunctionName and Call Form_MainFormName.TheFunctionName and yes the function is publi

I have also tried just accessing the data from subform1 like this: Me!Subform2.Form!ControlNam

If you can help give me any ideas I would appreciate it greatly. Thank you for your time.
 
M

Marshall Barton

Danielle said:
Hello~

I have a main form with 2 subforms. On the main form is a text box. I am trying to change the text in the text box when a certain event occurs in subform1. The text in the textbox will need to be accessed from subform2. So I am trying to program a line of code where subform1 recognizes subform2, gets the text, and puts it in the text box. I have tried a variety of ways including trying to call a functoin on the main form like this from subform1:
Call Forms!MainFormName.TheFunctionName and Call Form_MainFormName.TheFunctionName and yes the function is public

I have also tried just accessing the data from subform1 like this: Me!Subform2.Form!ControlName


Not sure I followed that, but I think you want something
like:

Me.Parent.textbox = Me.Parent.subform2.Form.controlname
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top