Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Re: possible to pull dates from a sub-form?

Discussion in 'Information Technology' started by MARTIN95, Jul 28, 2006.

  1. MARTIN95

    MARTIN95
    Expand Collapse
    Guest

    I appreciate your help...the first part is working.

    I renamed the date field to "servicedate". I created a text control
    "MaxApptDate" in the footer of the subform with the controlsource of
    =Max[(servicedate)]. This field now shows the final and most current date.

    The problem is with the second part on the main form.

    I created the unbound text control and created the ControlSource as

    =Forms![Call Listing Subform]!MaxApptDate

    But when I open the main form I just have #Name? showing in the field...HELP
    if you can...Thankyou in advance.

    MARTIN

    "Al Camp" wrote:

    > Martin,
    > In the footer of your subform create a calculated text control with a
    > ControlSource of...
    > = Max(ApptDate)
    > Name that field MaxApptDate for example.
    >
    > On your main form, place an unbound calculated TextControl with a
    > ControlSource of...
    > = frmYourSubName.Form!MaxApptDate
    > Name that field MainMaxStartDate.
    >
    > This will display the MaxStartDate value from the subform on the main
    > form, and update whenever the subform appts change.
    > You'll need to do a Refresh on the AfterUpdate event of ApptDate in the
    > subform to force a recalc.
    > --
    > hth
    > Al Camp
    > Candia Computer Consulting - Candia NH
    > http://home.comcast.net/~cccsolutions
    >
    > "MARTIN95" <MARTIN95@discussions.microsoft.com> wrote in message
    > news:1C7FA137-0260-4253-AE13-F7C60FAEF5A3@microsoft.com...
    > >i have a main form with a text field that is for "last appt. date", another
    > > form for appt. history. on my appt. history form is a sub-form where i
    > > can
    > > enter the client's entire appt history.
    > >
    > > my question, is it possible to make the "last appt. date" text field to
    > > look
    > > at the appt. history sub-form and pull the very last appt date and show it
    > > on
    > > the main form in the text field?
    > >

    >
    >
    >
     
  2. Loading...

    Similar Threads Forum Date
    Movies Ashdoc's movie review---Mission impossible 5 Rogue nation Theatre, Movies & Cinema Aug 12, 2015
    India Professor Bhullar's release possible after landmark SC judgement Breaking News Jan 21, 2014
    USA UPDATED! Dr. Prabjot Singh, Sikh Professor Attacked in Possible Hate Crime (2 Videos) Breaking News Sep 23, 2013
    A Shabad I came across - possible interpretations Sikh Sikhi Sikhism Aug 28, 2013
    To know God is to Love him, why this is not possible Sikh Sikhi Sikhism Mar 31, 2012

  3. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    I'm assuming that [Call Listing Subform] is the name of the form that you're
    using as a subform on your main form, and that you're trying to access it
    from that main form.

    In actual fact, if it's being used as a subform [Call Listing Subform] isn't
    recognized by Access as being open. To refer to something on it while it's
    being used as a subform, you have to refer to it as:

    Forms![NameOfMainForm]![NameOfSubformContainer].Form!MaxApptDate

    Note that [NameOfSubformContainer] may or may not be [Call Listing Subform].
    It all depends on how you created the subform. If you dragged [Call Listing
    Subform] onto the main form, then the container is probably named [Call
    Listing Subform]. If you created the subform by selecting the subform
    container from the tool box, drawing it onto the main form then supplying
    the necessary information (either manually or using the wizard), then the
    container's probably named something like Child0 (where 0 will vary).

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "MARTIN95" <MARTIN95@discussions.microsoft.com> wrote in message
    news:A783B49D-C866-4600-894D-D1C7310F69DB@microsoft.com...
    > I appreciate your help...the first part is working.
    >
    > I renamed the date field to "servicedate". I created a text control
    > "MaxApptDate" in the footer of the subform with the controlsource of
    > =Max[(servicedate)]. This field now shows the final and most current

    date.
    >
    > The problem is with the second part on the main form.
    >
    > I created the unbound text control and created the ControlSource as
    >
    > =Forms![Call Listing Subform]!MaxApptDate
    >
    > But when I open the main form I just have #Name? showing in the

    field...HELP
    > if you can...Thankyou in advance.
    >
    > MARTIN
    >
    > "Al Camp" wrote:
    >
    > > Martin,
    > > In the footer of your subform create a calculated text control with a
    > > ControlSource of...
    > > = Max(ApptDate)
    > > Name that field MaxApptDate for example.
    > >
    > > On your main form, place an unbound calculated TextControl with a
    > > ControlSource of...
    > > = frmYourSubName.Form!MaxApptDate
    > > Name that field MainMaxStartDate.
    > >
    > > This will display the MaxStartDate value from the subform on the main
    > > form, and update whenever the subform appts change.
    > > You'll need to do a Refresh on the AfterUpdate event of ApptDate in

    the
    > > subform to force a recalc.
    > > --
    > > hth
    > > Al Camp
    > > Candia Computer Consulting - Candia NH
    > > http://home.comcast.net/~cccsolutions
    > >
    > > "MARTIN95" <MARTIN95@discussions.microsoft.com> wrote in message
    > > news:1C7FA137-0260-4253-AE13-F7C60FAEF5A3@microsoft.com...
    > > >i have a main form with a text field that is for "last appt. date",

    another
    > > > form for appt. history. on my appt. history form is a sub-form where

    i
    > > > can
    > > > enter the client's entire appt history.
    > > >
    > > > my question, is it possible to make the "last appt. date" text field

    to
    > > > look
    > > > at the appt. history sub-form and pull the very last appt date and

    show it
    > > > on
    > > > the main form in the text field?
    > > >

    > >
    > >
    > >
     

Share This Page