Solved

VB6 check date filed

Posted on 2014-02-12
4
353 Views
Last Modified: 2014-02-12
How do I check for a blank date field? I think I am on the right track. If I enter a date, the code line - MsgBox "Expiration Date: " & Me.dtpExpDate, displays the date, but the date is left blank the check I do -
If dtpExpDate = "" Then
doesn't execute the line...
MsgBox "Expiration can not be Empty", vbExclamation

        MsgBox "Expiration Date: " & Me.dtpExpDate
        If dtpExpDate = "" Then
        'verify that Expiration Date is not empty
            MsgBox "Expiration can not be Empty", vbExclamation
            Me.dtpExpDate.SetFocus
            Exit Function
        End If

Any help would be appreciated.
Thanks in advance.

Please see the attached file for a complete description.
How-do-I-check-for-a-blank-date-.docx
0
Comment
Question by:tesla764
[X]
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
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:advfinance
ID: 39854486
Can you post your screenshot as an image? I can't view docx files on my phone.

--
Chris
0
 

Author Comment

by:tesla764
ID: 39854502
Here's a jpg.
Screen-Shot.JPG
0
 
LVL 5

Accepted Solution

by:
advfinance earned 500 total points
ID: 39854737
If memory serves, when you a have DateTimePicker with a checkbox like that and the checkbox isn't checked, the value is Null. You can test for that with IsNull(dtpExpDate.Value). Hope that helps.

--
Chris
0
 

Author Comment

by:tesla764
ID: 39854760
I got this ti work...
IsNull(dtpExpDate.Value)
Is the code that worked.
Thanks for your effort and attention to this.
I will award the points for your effrt.
Thanks.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is an explanation of a simple data model to help parse a JSON feed
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

751 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