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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prompting a user to make sure data entered is right 1

Status
Not open for further replies.

slickers

Technical User
Apr 17, 2000
2
US
This is my first project and it is a database for a ball club. First a new player registers with the Club. In the registration form there is a section for Player's info, Parents' info, Team, Payment, Coach. I have tables for each category then I create AgeGroup query and a form. Players' age or playing age is between 8-1-((YEAR) or Year before BDATE) and 7-31-BYEAR. For example if a player's BDATE is 8-12-83, the BDATE falls between 8-31-83 and 7-1-84 then that player may play under 16 (U16)or 84. If a player's BDATE is 12-3-89 then BDATE falls between 8-31-89 and 7-31-90 then this player may player under 10 (U10) or 90. What I need is when the user enters a BDate for the field to automatically determines the playing age group then ask the user if that's the correct playing age (Yes) or (No) and if No the user needs to manually enters the right playing age. Note: At times players may want to play up. Once that is determined it will be in the team report. Or may be in a control field in team report/Roster. Team report must have data related to the team. For example, Club Name, Team Name, Age Group, Seasonal Year, Color, Total Players, Coach Name, etc. Please help.<br><br>Eli
 
Suggestions: Don't store the dates for playing age in the database, just the playing age. Similarly, don't store the Total Players in the database. Normally you avoid storing the results of calculations. Instead you recalculate them every time you need to know or display them in a form, query or report.The reason is that you lose data integrity every time any component of the calculation changes. If you have to do the same calculation a number of times from different places, do the calc in a module and then call that function from your other objects (form, equery, report, etc.).<br><br>Here's a widely-published function for determining age:<br><br>Public Function Age (Bdate as Date) as Integer<br>&nbsp;&nbsp;&nbsp;&nbsp;Age = DateDiff(&quot;yyyy&quot;, Bdate, Date) + _<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Date &lt; DateSerial(Year(Date), Month(Bdate), _ <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Day(Bdate)))<br>End Function<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top