none
VB Help please RRS feed

  • Question

  • I want to set Project Status date to next Friday.

    I have:

    Do Until Weekday(NewstatusDate) = vbFriday

    NewstatusDate = NewstatusDate + 1

    Loop

    MyStatusDate = NewStatusDate

     

    But this just give me 22/04/2011 (UK date format), but I want to add 17:00:00 time (end of day)

     

    How please?

     

    Chas.

    Wednesday, April 20, 2011 9:30 AM

Answers

  • Hi Chas,

    have you checked the time, which is used (maybe 00:00)? Just change date format in otions dialog (2007: Tools - Options - View, 2010: File - Options). If so, you could use "ActiveProject.StatusDate = DateAdd("h", 17, NewstatusDate)"

    Does that help?
    Barbara

    • Marked as answer by ChasDytham Wednesday, April 20, 2011 10:57 AM
    • Unmarked as answer by ChasDytham Wednesday, April 20, 2011 10:57 AM
    • Marked as answer by ChasDytham Wednesday, April 20, 2011 11:01 AM
    Wednesday, April 20, 2011 9:46 AM
    Moderator

All replies

  • Hi Chas,

    have you checked the time, which is used (maybe 00:00)? Just change date format in otions dialog (2007: Tools - Options - View, 2010: File - Options). If so, you could use "ActiveProject.StatusDate = DateAdd("h", 17, NewstatusDate)"

    Does that help?
    Barbara

    • Marked as answer by ChasDytham Wednesday, April 20, 2011 10:57 AM
    • Unmarked as answer by ChasDytham Wednesday, April 20, 2011 10:57 AM
    • Marked as answer by ChasDytham Wednesday, April 20, 2011 11:01 AM
    Wednesday, April 20, 2011 9:46 AM
    Moderator
  • Yes, thanks Barbara, the DateAdd("h", 17, NewstatusDate) was just what was needed.

     

    Chas.

    Wednesday, April 20, 2011 11:01 AM