Update contol in subform2 from subform1

  • Thread starter Thread starter Silvio
  • Start date Start date
S

Silvio

This is what I have:

Main Form Subform2 Control in sub2
Forms!frmEditProject!frmProjectsCyclesSub.From!DateComplete = Date

Sytax:
After pressing a button in subform1
Got to Subform2
Go to Control DateComplete and enter today's date

Obviously it is not working, what wrong with it?

Thank you for your help.
Silvio
 
Jeanette, I did and if I understand correctly my line should work but it does
not. Do you see where my mistake is?
 
Silvio,
this is what I believe it should be

Me!Subform2.Form!Subform3.Form!ControlName

Note: Me is the form the button is on - subform1
Subform2 is the name of the subform control on subform1.
The name of the subform control is often different from the name of the form
inside the subform control.
For this to work, you need to use the name of the subform control, not the
form inside it.

To test it out, when you have the form open, put a debug print at that point
in the code like this
debug.print Me!subform2
debug.print Me!subform2.Form
debug.print Me!subform2.Form!Subform3.Form!ControlName

run the form and press Ctl + G to open the immediate window and see what
values access gets for Me!Subform2 etc

This is a very handy feature to help with debugging the code.


Jeanette Cunningham -- Melbourne Victoria Australia
 
Back
Top