Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9293239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:05:23+00:00 2026-06-18T21:05:23+00:00

I have a form made with VB6 and I need to check the date

  • 0

I have a form made with VB6 and I need to check the date field for future dates.

If the date entered is in the future an error message should show and if it is not, the validation should finish.

I’ve done:

Private Sub txtDate_Validate(Index As Integer, Cancel As Boolean)
If Not IsDate(txtDate(9).Text) Then 'first I check if the data entered is a date
'error message saying the field needs a valid date
  Cancel = True
        Else
      If (txtDate(9).Text > Date) Then 'now I check if the date entered is bigger than today’s date 
                'error message saying the date is in the future 
                Cancel = True
            Else
               Exit Sub
            End If
       End If 
End If
End Sub

This code does not work because

txtDate(9).Text > Date

is always true

Even if I do:

Format(txtDate(9).Text, "dd/mm/yyyy") > Date

is always true too

What can I do to fix this? How can I know if the date entered is in the future?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T21:05:24+00:00Added an answer on June 18, 2026 at 9:05 pm

    Use CDate to convert the content of the textbox to a Date.

    Can’t stress this enough if it’s got quotes round it, it’s a string.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my iOS application I have made a form that should submit data into
I have a form made in JSP, here I have multiple buttons - Approve,
I have a contact form made with php on my website. The problem is
I have made a form validation using ajax post method. But i got the
I have made a form that accepts query and executes it through php. I
I made register form where you have to put in all your personal info.
I have a dynamic form that adds users to the site, made so you
I have a registration form on my layout grid, made out of a stackPanel.
I have made a custom form in a module where I have used a
I have made a Base Form which is inherited by most Forms in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.