Add to a value in a text box

  • Thread starter Thread starter Guest
  • Start date Start date
G

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
 
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]
 
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 said:
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]
 
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]
 

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

Back
Top