Jump to content

How can I auto-update a field?


This topic is 8285 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I'm programming a database for high school students, and I want to automatically increment each students' grade by 1 year dependent upon the year of graduation.

The field Stu_GradYear accepts the year of graduation as a four digit year only.

The value list Stu_Grade contains these values: 9, 10, 11, 12, Graduate

For the 2000-2001 (last) school year; 2001 = 12, 2002 = 11, 2003 = 10, etc.

For the 2001-2002 (coming) school year; 2001 = Grad, 2002 = 12, 2003 = 11, etc.

The school new year starts in September. On September 30, I want class of 2001 to change from 12 to Graduate, class of 2002 to change from 11 to 12, etc.

Is there a way to automatically make these changes?

I'm assuming I have to create an Apple Event and/or calculation to make these changes?

Link to comment
Share on other sites

Create a new field Stu_CompYear (calculation)

TextToDate ( "9/30/" & Stu_GradeYear )

Convert your field Stu_Grade to a calculated text field

Case (

Stu_CompYear - status ( currentdate ) <= 0, "Graduate",

Stu_CompYear - status ( currentdate ) <= 365, "12",

Stu_CompYear - status ( currentdate ) <= 2*365, "11",

Stu_CompYear - status ( currentdate ) <= 3*365, "10",

"9"

)

Link to comment
Share on other sites

This topic is 8285 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.