Array?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm looking for the best way to do the following:

On a form, I have a user enter a beginning and end date (Ex: 1/1/04,
12/31/04) - can be any 12 month period. Then, I want to use those 12 months
as labels on a report. Since it can be any 12 month period, I need to
populate the report headers based on the beginning month, ending month and
all months in between.

What's the best way to do this? Using an array??

Thanks!
 
In a report? Assuming that you just need "header" labels, I'd probably use
textboxes to hold the header's contents.

I would then use an expression similar to this in the first textbox:

=Format(CDate(Forms!FormName!ControlName), "mmmm")

Then in the second textbox:

=Format(DateAdd("m", 1, CDate(Forms!FormName!ControlName)), "mmmm")

In the third:

=Format(DateAdd("m", 2, CDate(Forms!FormName!ControlName)), "mmmm")

and so on to the 12th:

=Format(DateAdd("m", 11, CDate(Forms!FormName!ControlName)), "mmmm")
 
Back
Top