L
lsnoble
I've bashed my head against this all day, and gee, my head hurts! I've
pulled out an awful lot of my hair over this problem. Hope someone can
help with this:
I've created a residential lease contract as a simple form where users
can input basic data involved in the lease agreement, such as Lessor's
name, Lessee's name, and so forth. In the terms of the lease, I want
users to be able to enter the start date of the lease (e.g., March 1,
2007), but I want the end date to be calculated automatically in the
next field so that the end date is one year from the start date (e.g.,
February 28, 2008). I've read what seems like volumes of material about
using the DateAdd function in VBA, which should allow me to run a macro
with this code OnExit from the start date field, but none of the code
I've tried works! GAAAAHH! I'm not at all familiar with using VBA, so I
don't understand how and where to type the code for the DateAdd
function.
The best work-around I've found is to create separate fields for the
years (i.e., a field for "March 1" and a field for "2007), then add a
formula to the field where I want to force the year to update by 1.
Easy, but my client doesn't seem satisfied with this. The client wants
the form to be as error-proof as possible, and doesn't even want users
to have to type in "February 28" (for example).
I would really appreciate some help with this, since I don't have much
hair left.
L.
pulled out an awful lot of my hair over this problem. Hope someone can
help with this:
I've created a residential lease contract as a simple form where users
can input basic data involved in the lease agreement, such as Lessor's
name, Lessee's name, and so forth. In the terms of the lease, I want
users to be able to enter the start date of the lease (e.g., March 1,
2007), but I want the end date to be calculated automatically in the
next field so that the end date is one year from the start date (e.g.,
February 28, 2008). I've read what seems like volumes of material about
using the DateAdd function in VBA, which should allow me to run a macro
with this code OnExit from the start date field, but none of the code
I've tried works! GAAAAHH! I'm not at all familiar with using VBA, so I
don't understand how and where to type the code for the DateAdd
function.
The best work-around I've found is to create separate fields for the
years (i.e., a field for "March 1" and a field for "2007), then add a
formula to the field where I want to force the year to update by 1.
Easy, but my client doesn't seem satisfied with this. The client wants
the form to be as error-proof as possible, and doesn't even want users
to have to type in "February 28" (for example).
I would really appreciate some help with this, since I don't have much
hair left.
L.