Increasing month in date

J

Jeff

Hi Everybody,

I have a report that prints invoices. It will print 6 invoices and I
want the payment date to change for the 15th of each month; therefore I
can print a payment book for each customer for the whole 6 months.

I got the invoice to print 1:6, 2:6 etc, but I want to change the
payment date.

Any help would be greatly appreciated.

Thanks

Jeff
 
G

Guest

Hi Jeff,

If I'm understanding you correctly, you want to print a series of 6 pages
with dates showing successive months, all the 15th day, starting with some
designated month. For example, if it were the beginning of October, you would
want page 1 to have "October 15, 2005", page 2 to have "November 15, 2005",
etc.

If that's what you're after, this will do the trick. In an unbound text box,
enter the following:

=Format((DateSerial(Format(Date(),"yyyy"),Format(Date(),"mm")+([Page]-1),15)),"mmmm dd"", ""yyyy")

This generates a series of dates based on the current month and the page
number, starting with (Current Month) 15, (Year). If you want to start with
a different month than the current, use the "-1" in the formula as an offset.
"-1" will always start with the current month, "-2" would start with last
month, "0" would start with coming month, etc.

The DateSerial function is really nice in that it's one of the best ways to
count dates forwards or backwards based on year, month, day and know that
your years will calculate properly (e.g., DateSerial(2005, 2-5, 1) generates
10/1/2004 even though you're only subtracting from the months field).

HTH,


Keith Hufford
EHP, Inc.
 
J

Jeff

Thanks Keith,

I forgot to tell you that I'm using the Portuguese version and there
must be some kind of difference in the syntax because it keeps telling
me I forgot a comma, didn't close quote marks or an operator is missing.

When the whole syntax is perfect it translates the English code
automatically into Portuguese. I tried messing around with the basic
code you gave, including commas, quotes and stuff, but no luck.

I'll keep trying and I'll try the Portuguese site too.

Thanks a lot

Jeff
 

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

Top