Hi Roger,
In the code you presented RunStartTime is never changed so this statement:
datNextNotificationDateTime = Me.RunStartTime.AddMinutes(intContactInterval)
... always sets datNextNoficiationDateTime to the result of the value of
RunStartTime + 15 minutes. (The statement assigns the result of
Me.RunStartTime.AddMinutes(intContactInterval) to
datNextNotificationDateTime, it does not change the value of RunStartTime)
If you wish to leave RunStartTime's initial value alone, AddMinutes to
datNextNotificationDateTime instead:
datNextNotificationDateTime =
Me.datNextNotificationDateTime.AddMinutes(intContactInterval)
--
Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com
"Roger Twomey" <(E-Mail Removed)> wrote in message
news:uzN1R$(E-Mail Removed)...
> I am doing something wrong here but I cannot see it.
>
> I have the following lines of code:
>
> datNextNotificationDateTime =
Me.RunStartTime.AddMinutes(intContactInterval)
> WriteLog("NextNotificationDateTime is: " +
> datNextNotificationDateTime.ToShortDateString)
>
> So if I run the code line like this:
>
> datNextNotificationDateTime =
Me.RunStartTime.AddMinutes(intContactInterval)
> (where intContactInterval = 15)
>
> I get datNextNotificationDateTime as the exact same (unchanged, original)
> Me.RunStartTime value. It does not appear to be adding 15 minutes.
> (the WriteLog function is writing to the EventViewer application log..
this
> is a service so I cannot throw an error and see it.)
>
> Any ideas how this could be possible??
>
>