Link to home
Start Free TrialLog in
Avatar of SteveL13
SteveL13Flag for United States of America

asked on

Populate date field on a 2nd subform with stored value of the 1st subform

I have a form with 7 subforms.  Each of the subforms has a date field and the control source is Me.txtScheduleDate = Forms!frmScheduleDateRange.txtStartDate for Sunday, Me.txtScheduleDate = Forms!frmScheduleDateRange.txtStartDate + 1 for Monday, Me.txtScheduleDate = Forms!frmScheduleDateRange.txtStartDate + 2 for Tuesday, etc. through Saturday.

On the subform is a command button that opens a 2nd subform.  The 2nd subform has date field that I want to populate with the date from the 1st subform.  Is this a case for a TempsVar to be used?   If so, I don't know how to code it.  Maybe a temporary variable in the command button on click event can be stored and then used in the date field in the 2nd subform?
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

In the second subform (the "subsubform"), just use as ControlSource  for the textbox:

=[Parent]![DateFieldOnParentSubform]

Open in new window

Avatar of SteveL13

ASKER

My mistake in the explanation.  The 2nd subform isn't really a subform.  It is a stand-alone form.  The date has to come from one of 7 subforms.  I don't know how to let it know which subform launched it.
SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial