Solved

VB6 check date filed

Posted on 2014-02-12
4
352 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
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSumClump challenge 9 137
draw a Christmas tree by using a nested loop? 26 88
Help Required 2 46
convert Systemjs to Webpack 3 71
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

679 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