Date Calculation

gsrajan

Registered User.
Local time
Today, 13:10
Joined
Apr 22, 2014
Messages
227
I need your help please. It looks very hard to me. It is like a date calculator.

1. I have 12 unbound text boxes in the unbound form in 6 pairs.

2. Text1 receives the arrival date and Text2 receives departure date, Text3 receives arrival date and Text4 receives the departure date and so on.

3. A person may have any number of arrivals and departures
between 1 to 6.

4. The person should not stay in this country for more than 6 years.

I need to calculate from the final departure date, the total number of days the person stayed in this country and the remaining allowable years months and days the person can stay in this country ( deducted from the 6 years period ).

5. Please note the final departure date can be in Text2 or Text4 or Text 6 field.

Thanks for your help.
 
I'm sorry, but you haven't asked any specific questions. Honestly, this isn't too difficult of a task for anyone who has gone under the hood of Access forms. So, I am guessing you are a relative beginner.

In that case, my suggestion is to read up on a few Access form tutorials. I would google "MS Access Calculator", it won't be exactly what you want, but it will give you the baseline skills necessary for what you want.

If, I'm wrong in my assessment, ask specific questions about what issue is giving you trouble.
 
Thank you,

My specific question is how to address the last departure date in my date calculation, since it could be either in text2 or text4 or text 6.

Thank you.
 
Aren't they essentially pairs? The even number Text box is the departure date for the one prior to it (Text1-Text2, Text3-Text4, Text5-Text6..). If so, it seems the last departure date is irrelevant. You don't need to know when it occured, you just want to add all the time between those pairs together and subtract it from 6 years.

1/1/2010 - 12/31/2010
2/1/2011 - 12/31/2011
2/1/2012 - 12/31/2012
2/1/2012 - 12/31/2013

Time spent in country: 45 months
Available time remaining: 27 months

What did I miss? Why do you need to know the last departure date? Can you demonstrate it with some sample data?
 

Users who are viewing this thread

Back
Top Bottom