Help help help

R

Randy

Scenario: I am attempting to auto calculate some fields. I have a program
that prints rental leases.
I have 4 fields as follows:
Months = [Term]
Days = [TermDays]
Begin Date = [LeaseBeginDate]
End Date = [LeaseEndDate]

What I need is for the user to be able to enter the number of months the
lease is for [Term]…Once they have entered the number of months they would
enter the lease begin date [Lease Begin Date]…I need the program to calculate
the lease end date [Lease End Date] based on the number of months entered in
the [Term] field.

i.e.; lease begins 2/15/06 and is for 12 months. The lease end date should
be 2/28/07.

I also need the days [TermDays] to calculate the difference between 2/15/06
and 2/28/06 and enter this number into the field [TermDays] automatically.
This is because if the lease begins on 2/15/06 and is for one year (12 mo)
that would run from 2/15/06 to 2/15/07, but we need the lease end date to be
the end of the month. So we need to add the number of days from 2/15/07 to
2/28/07.

This is what I have so far and have gotten stuck…It works for just the lease
dates as long as the [Term] it is only 12 months. When I put 6 months it
seems to cut off a few days.

=DateAdd("m",+[Term],[Lease Begin Date]-1)

I hope this is somewhat clear. Should you need more info please let me know.
I thank you for any assistance you could provide.
 
K

Ken Snell \(MVP\)

You can use the DateSerial function to do what you seek. Assuming that
[Lease Begin Date] is a control or field that is accessible to the
expression that we'll need, this expression should do what you want:

LeaseEndDate = DateSerial(Year([Lease Begin Date]), Month([Lease Begin
Date]) + 1 + [Term], 0)
 
R

Randy

You rock! Worked like a charm! thank you so very much!
--
Randy Street
Rancho Cucamonga, CA


Ken Snell (MVP) said:
You can use the DateSerial function to do what you seek. Assuming that
[Lease Begin Date] is a control or field that is accessible to the
expression that we'll need, this expression should do what you want:

LeaseEndDate = DateSerial(Year([Lease Begin Date]), Month([Lease Begin
Date]) + 1 + [Term], 0)

--

Ken Snell
<MS ACCESS MVP>

Randy said:
Scenario: I am attempting to auto calculate some fields. I have a program
that prints rental leases.
I have 4 fields as follows:
Months = [Term]
Days = [TermDays]
Begin Date = [LeaseBeginDate]
End Date = [LeaseEndDate]

What I need is for the user to be able to enter the number of months the
lease is for [Term].Once they have entered the number of months they would
enter the lease begin date [Lease Begin Date].I need the program to
calculate
the lease end date [Lease End Date] based on the number of months entered
in
the [Term] field.

i.e.; lease begins 2/15/06 and is for 12 months. The lease end date
should
be 2/28/07.

I also need the days [TermDays] to calculate the difference between
2/15/06
and 2/28/06 and enter this number into the field [TermDays] automatically.
This is because if the lease begins on 2/15/06 and is for one year (12 mo)
that would run from 2/15/06 to 2/15/07, but we need the lease end date to
be
the end of the month. So we need to add the number of days from 2/15/07 to
2/28/07.

This is what I have so far and have gotten stuck.It works for just the
lease
dates as long as the [Term] it is only 12 months. When I put 6 months it
seems to cut off a few days.

=DateAdd("m",+[Term],[Lease Begin Date]-1)

I hope this is somewhat clear. Should you need more info please let me
know.
I thank you for any assistance you could provide.
 

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

Similar Threads

Template Prompts 1
DateAdd problem 2
Folmula Help 4
Need help 2
Countdown macro - display settings 2
look up maximum date in a range 8
days between end of one record and start of another 12
Lease Option Date 1

Top