Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reach control subform

Status
Not open for further replies.

phpatrick

Programmer
Jul 9, 2006
72
BE
Hi, I already review several posts but I could not find the right syntax.

situation
Mainform Form_Contact
Subform Form_Time
Control SHIFT1VAN in Subform

In the subform I have a button, when the user clicks the event onclick the current time 12.11 should set to the control of the subform.

Ive don it before, but can't find the right syntax anymore.
 
Forms!F_TIME!SHIFT1VAN = Now()

This works but when I am in this form, but I should reach this from the main form where this subform is in. How to ?
 
Forms![main form name]![subform control name].Form![control name]
 
From the main form, the syntax is:

1. [tt]Me.[/tt] or [tt]Forms![Name of Main Form].[/tt]
2. [tt][Subform Control Name][/tt]
Make sure this is the name of the subform control, not the form that is contained by this control. That is covered with a straight:
3. Form.
4. [tt][Control Name][/tt]

So, for the above, perhaps something like:

[tt]Me.F_TIME.Form.SHIFT1VAN = Now()[/tt]

See:
 
Another useful link:

Feel free to play with the expression builder (loaded forms) to discover the name of your controls.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top