Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Return Sunday date of week selected (AXP)

    I have a DTPicker control on a form. What I want to happen is for the control to return only the date associated with Sunday of what ever week is highlighted. For instance, if the control is set for Tuesday, I want the output to be the previous Sunday. It sounds silly but I need this for some expense report related stuff.


    Thanks,
    Mark

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Return Sunday date of week selected (AXP)

    I don't think you can make the DTPicker return a Sunday, but you can easily compute it:

    Dim datSunday As Date
    ' Get value of DTPicker
    datSunday = dtpMyPicker.Value
    ' Compute last Sunday on or before date
    datSunday = datSunday - Weekday(datSunday) + 1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •