Update contol in subform2 from subform1

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
 
S

Silvio

Jeanette, I did and if I understand correctly my line should work but it does
not. Do you see where my mistake is?
 
S

Silvio

Correction: The control to update is located in subform3 wich is in located
in suform2.
 
J

Jeanette Cunningham

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
 

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