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

  • SEARCH
  • Home
  • 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 8341943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:37:51+00:00 2026-06-09T05:37:51+00:00

I have an excel form that I created in combination with VBA. In the

  • 0

I have an excel form that I created in combination with VBA. In the form I have a textbox in which the user is to type in a date.

I have created this VBA clause to ensure the user types in a date that supports the format xx/xx/xxxx.

If Not IsDate(textboxDate1.Text) Then
  Call MsgBox("Please select a correct Date format", vbOKOnly)
  Exit Sub
End If

However, with this VBA code, the user is required to enter a date, whether the user needs to or not. So when I have a 4 other textboxes to input a date in my form, and the user only needs to enter in 1 date, and not 5, I have the problem where the user is required to put in a date for the other four textboxs in order submit the form.

So my question:
What VBA code is available to first determine whether text exists in the textbox, and then second to determine whether the date is in the correct format or not.

I was trying something similar to this:

 If textboxDate1.ListIndex = -1 Then

but I couldn’t get it to work with the IsDate clause.

Many thanks in advance.

  • 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-09T05:37:52+00:00Added an answer on June 9, 2026 at 5:37 am
    If (Len(Trim(textboxDate1.Text)) <> 0)  And Not IsDate(textboxDate1.Text) Then 
      Call MsgBox("Please select a correct Date format", vbOKOnly) 
      Exit Sub 
    End If 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a macro for excel which will pop up form that contains
I have a .net form that is created in Excel (I don't know if
I have an Excel Add-In that pops up a form. If the user fills
I have an EXCEL sheet.it has various form-fields that are named as smrBgm133GallonsGross/ smrBgm167GallonsGross
I have a textbox on a MS Access form that users are going to
I have an Excel VBA sub that (among other things) pastes a lookup formula
I'm having big problems doing operation with the date in Excel VBA. I have
I have an excel file that I would like to load into my form
I have an Excel sheet on which I have created a list consisting of
I have created an application which converts Excel files to Access databases. During conversion

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.