Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / March 2005

Tip: Looking for answers? Try searching our database.

Array?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
J - 03 Mar 2005 20:15 GMT
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!
Ken Snell [MVP] - 03 Mar 2005 21:40 GMT
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")
Signature


       Ken Snell
<MS ACCESS MVP>

> I'm looking for the best way to do the following:
>
[quoted text clipped - 8 lines]
>
> Thanks!
J - 04 Mar 2005 19:23 GMT
What if I want to use those values in other places, like docmd.runsql
statements.

> In a report? Assuming that you just need "header" labels, I'd probably use
> textboxes to hold the header's contents.
[quoted text clipped - 26 lines]
> >
> > Thanks!
Ken Snell [MVP] - 04 Mar 2005 20:53 GMT
Then you would want to use an array variable, yes.

Signature

       Ken Snell
<MS ACCESS MVP>

> What if I want to use those values in other places, like docmd.runsql
> statements.
[quoted text clipped - 31 lines]
>> >
>> > Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.