Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Validation of Text

Posted on 1999-08-02
Medium Priority
Last Modified: 2010-04-30
How do i validate the a start and end date on a visual basic form? This start and end date will then be used to produce a report in crystal.
Question by:lorna99
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 18

Expert Comment

ID: 1528898

Accepted Solution

stewfidgeon earned 150 total points
ID: 1528899
You can use the IsDate() function.


Result = IsDate(MyDate)

If MyDate is valid, result will be true, if its not a valid date, the result will be false.

DateValue is just a command to converta text string into a date value.

If you want to verify a range of dates, you could ensure that the second date is later than the first like this:

If FirstDate >= SecondDate Then
   ' Date range is valid.

If you need any more advice, just post a comment here.



Expert Comment

ID: 1528900
you can use calender control for inputing the date

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

670 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