target date is first Sunday from today's date

Posted on 2009-02-11
Last Modified: 2012-05-06
I have a formfield textbox that has a dropdown calendar attached to it.

Here are my questions:
1. How can I autopopulate the first coming sunday in the txt field: Me.txtTargetDate.Text = DateTime.Now.AddMonths(+3).ToString("d"). What do I replace the AddMonths(+3) with?
2. How can I disable all other days (except for Sunday) on the ajax calendar?
or if that's not possibel how can I validate that Sunday are only valid days to be selected?

Thanks  a lot!
Question by:JessyRobinson1234
    1 Comment
    LVL 39

    Accepted Solution

    DateTime.Now.AddDays(7 - DateTime.Now.DayOfWeek)

    to validate is sunday:

    if DayOfWeek.Sunday.CompareTo(ctype(.txtTargetDate.Text,date))= 0 then
    'is sunday.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
    In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    6 Experts available now in Live!

    Get 1:1 Help Now