[AccessD] For next loop - using date criteria

Robert L. Stewart rl_stewart at highstream.net
Thu Dec 14 06:43:20 CST 2006


So here is the code you should be using...

Public Sub DateIncrementer()
     Dim StartDate As Date
     Dim EndDate As Date
     Dim I As Date
     StartDate = #11/1/1948#
     EndDate = #11/1/2006#
     Debug.Print StartDate
     Do Until StartDate >= EndDate
         StartDate = DateAdd("m", 1, StartDate)
         Debug.Print StartDate
     Loop
End Sub

I think I used to do some work with Kinder Morgan also.
Where are you located?


At 06:16 PM 12/13/2006, you wrote:
>Date: Wed, 13 Dec 2006 13:09:45 -0800
>From: "Charlotte Foust" <cfoust at infostatsystems.com>
>Subject: Re: [AccessD] For next loop - using date criteria
>To: "Access Developers discussion and problem solving"
>         <accessd at databaseadvisors.com>
>Message-ID:
>         <F55048AF7E974F429BB24597D7355EEA178743 at INFOSERVER04.infostat.local>
>Content-Type: text/plain;       charset="us-ascii"
>
>Again, to what purpose?  If you just want to step from the first to the
>first, just use DateAdd and add a month to the latest date using an Do
>Until loop and testing for a date > the end of the desired range.
>
>Charlotte Foust
>
>-----Original Message-----
>From: accessd-bounces at databaseadvisors.com
>[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester
>Sent: Wednesday, December 13, 2006 11:52 AM
>To: Access Developers discussion and problem solving
>Subject: Re: [AccessD] For next loop - using date criteria
>
>I am trying to loop from 11/1/1948 to 11/1/2006 stepping from the first
>day of one month to the first day of the next month.





More information about the AccessD mailing list