Welcome to SPN

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

Sign Up Now!

Add to a value in a text box

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

Tags:
  1. CoachBarkerOJPW

    CoachBarkerOJPW
    Expand Collapse
    Guest

    I have a field in my data base where we track how many years a person has
    participated. What I would like to do is when a new record is added
    txtYearsParticipated should be set to one. Then every year they register
    after the first year the text box would increase by one when teir record is
    updated. The poblem is I have no idea when to increase, if the record is
    updated during the season I don't want the participation years to change. any
    help would greatly be appreciated.
    Thanks
     
  2. Loading...


  3. John Vinson

    John Vinson
    Expand Collapse
    Guest

    On Wed, 19 Jul 2006 19:25:02 -0700, CoachBarkerOJPW
    <CoachBarkerOJPW@discussions.microsoft.com> wrote:

    >I have a field in my data base where we track how many years a person has
    >participated. What I would like to do is when a new record is added
    >txtYearsParticipated should be set to one. Then every year they register
    >after the first year the text box would increase by one when teir record is
    >updated. The poblem is I have no idea when to increase, if the record is
    >updated during the season I don't want the participation years to change. any
    >help would greatly be appreciated.
    >Thanks


    This field SHOULD NOT EXIST.

    If you just want to display the number of years, calculate it as
    needed. Store the date first registered in the table, and use an
    expression like

    =DateDiff("yyyy", [DateRegistered], Date())

    as the Control Source of the textbox txtYearsParticipated.

    John W. Vinson[MVP]
     
  4. CoachBarkerOJPW

    CoachBarkerOJPW
    Expand Collapse
    Guest

    This field is required for two reasons. 1) We award players a different pin
    for each year they have played (this is for a Pop Warner football
    association) and 2) so we can have an accurate count of the years adults have
    volunteered their help.

    DateDiff won't work because not all players play every year and not all
    adults volunteer every year so it would count the years they did not play and
    did not volunteer.

    "John Vinson" wrote:

    > On Wed, 19 Jul 2006 19:25:02 -0700, CoachBarkerOJPW
    > <CoachBarkerOJPW@discussions.microsoft.com> wrote:
    >
    > >I have a field in my data base where we track how many years a person has
    > >participated. What I would like to do is when a new record is added
    > >txtYearsParticipated should be set to one. Then every year they register
    > >after the first year the text box would increase by one when teir record is
    > >updated. The poblem is I have no idea when to increase, if the record is
    > >updated during the season I don't want the participation years to change. any
    > >help would greatly be appreciated.
    > >Thanks

    >
    > This field SHOULD NOT EXIST.
    >
    > If you just want to display the number of years, calculate it as
    > needed. Store the date first registered in the table, and use an
    > expression like
    >
    > =DateDiff("yyyy", [DateRegistered], Date())
    >
    > as the Control Source of the textbox txtYearsParticipated.
    >
    > John W. Vinson[MVP]
    >
     
  5. John Vinson

    John Vinson
    Expand Collapse
    Guest

    On Thu, 20 Jul 2006 04:07:01 -0700, CoachBarkerOJPW
    <CoachBarkerOJPW@discussions.microsoft.com> wrote:

    >This field is required for two reasons. 1) We award players a different pin
    >for each year they have played (this is for a Pop Warner football
    >association) and 2) so we can have an accurate count of the years adults have
    >volunteered their help.
    >
    >DateDiff won't work because not all players play every year and not all
    >adults volunteer every year so it would count the years they did not play and
    >did not volunteer.


    My question isn't about *displaying* the field, it's about *storing it
    in the table*.

    I guess my question is: can the value of this yes/no field be
    calculated from data already in the table? If so, you don't need to
    (and should not!) store it, since it will - as you say - become out of
    date every year. I would suggest that you use a Totals query to count
    years in which a player has played (or a volunteer has participated).

    John W. Vinson[MVP]
     

Share This Page