Date Calculation

GerryD

New member
Local time
Today, 06:47
Joined
Sep 29, 2010
Messages
3
I am trying to write a complicated date calculation. I am an attorney writing a DB for myoffice. I am attempting to calculate the Statute of limitations for a case. There are two complications. First, the statute does dont begin to run until the client reaches the age of 18 and second thee are different statutes for different types of cases . For example, there is a one year statue of limitations for a dafamation case, a two year statute for an auto accident and a 4 year statute for a contract action. I have solved the first issue with a calculated text box. The calculation determines the difference between date of birth and the Incident date and tells me whether or not it is less than 18. The calculation is =DateDiff("yyyy",[DOB],[IncidentDate])+Int(Format([IncidentDate],"mmdd")<Format([DOB],"mmdd")). This works perfectly. For example, my daughter's date of birth is August 28, 1985. If she were in an auto accident on August 20, 2000, this calculation would return a value of 14 in the calculated text box, telling me she was not 18 at time of acxcident and that the statue of limitations would not begin to run til she reached 18. It is the second issue I need help with.

I have the following relevant fields in my form. I have a Birthdate Field(DOB), an incidentdate field(Incidentdate), a statute of limitations field(SOL) whicd records whether the statute is 1 year, 2 years or 4 years and the statute date field(Statutedate) and my calculated teaxbox that I described above (Text19). I need to write code for my statutedate field which says the following: "If Text19 is < 18 Statutedate =DOB +SOL + 18, otherwise, StatuteDate =IncidentDate + SOL"
Can anyone help me with this code. I want to put it in the after update event of the Statute of Limitations(SOL) field. Thank you
 
Not being a legal person I'm a little confused with your formula Statutedate =DOB +SOL + 18
To me this means if your daughter was born in 2000, the accident was in 2010, and the SOL was 4 years then the answer you would get is 2022.
If the person was over 18 then the answer would be 2014. (2010 + 4).
Does this mean an under 18 year old person has to wait longer for the statute of limitations to apply? One would have to question why a 10 year old was driving but it could happen :).
 
sonof27
To me this means if your daughter was born in 2000, the accident was in 2010, and the SOL was 4 years then the answer you would get is 2022.
If the person was over 18 then the answer would be 2014. (2010 + 4).
Does this mean an under 18 year old person has to wait longer for the statute of limitations to apply? One would have to question why a 10 year old was driving but it could happen

From my understanding of SOL it is the maximum time from the date of the incident that a client can initiate court action. Using your example above as person over 18 must initiate court action within 4 years of the incident. For a person under 18 that person must initiate court action within the date of the incident and 4 years after turning 18. The 10 year old would be a passenger in the vehicle.

GerryD
Attached is a sample database that will suit your needs. Note, I have used different field names on the form.
 

Attachments

"Not being a legal person I'm a little confused with your formula Statutedate =DOB +SOL + 18
To me this means if your daughter was born in 2000, the accident was in 2010, and the SOL was 4 years then the answer you would get is 2022.
If the person was over 18 then the answer would be 2014. (2010 + 4).
Does this mean an under 18 year old person has to wait longer for the statute of limitations to apply? One would have to question why a 10 year old was driving but it could happen".

Poppa is correct. It does not mean that a person under 18 has to wait. What it means is that a minor can file suite anytime after the incident date but must file within 4 years of reaching 18 assuming the SOL is 4 years. If the SOL is only 2 years they must file within two years of reaching 18. On the otherhand if a person is 18 or older on the date incident happens they must file suit within 4 years of the incidentdate if SOL is 4 years or within 2 years if the SOL is 2 years. Poppa is also correct that the child is not a driver. He or she would be a passenger or perhaps riding his or her bike and is injured beacause of a defect in the bike or is injured when they slip and fall on a patch of ice on a neighbors sidewalk. There are numerous circumstances in which a person under 18 maye be injured and have a lawsuit for their injuries other than as the driver of a car.
But you miss my question. The formula I set forth initially in my calculated text box works. It tells me if the person is 18 or not on the date of the incident. What I am looking for is an event procedure or formula that says If the value of my calculated textbox(Text19) is less than 18 add 18 plus the value of SOL to the dateofbirth field(DOL) otherwise add the value of SOL to the IncidentDate.
Poppa Access wont let me open the event procedure you wrote in your sample db. It locks up on me everytime. Can you just post the event procedure here. Thank you.
 
Poppa,
Never mind. I got it and it works perfectly. I had opened it at home and I have access 2003 at home. Thats why it locked up on me. I have access 2007 at the office and when I opened it in access 2007 it worked perfectly once I changed the fieldnames. Thank you for your help. I greatly appreciate it. I do have one question. It appears that your code eliminates the need for my calculated text box. Am I correct?
 
Your welcome, I normally upload databases created in 2007 but saved in 2003 to the site.

Yes, you are correct

' determine the limitation date
If client_age_incident < 18 Then
child_limitation = 18 + Me!statute_limitations
Me!limitation_date = DateAdd("yyyy", child_limitation, Me!client_dob)
Else
Me!limitation_date = DateAdd("yyyy", Me!statute_limitations, Me!incident_date)
End If

In the above child_age_incident is the age of the child at the time of the incident which is equivalent to your Text19. The me!limitation_date calculation is similar to your "If Text19 is < 18 Statutedate =DOB +SOL + 18, otherwise, StatuteDate =IncidentDate + SOL"

Using variables in the codes reduces the need for textboxes, which maybe meaningless to the user.
 

Users who are viewing this thread

Back
Top Bottom