Solved

VB6 check date filed

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Magic Software info 18 124
cmd.exe will not close when running .bat file to perform FTP upload 18 93
Non-recursive backtracking, using a stack 1 96
Plain Text Editor for iPad 6 55
A short article about problems I had with the new location API and permissions in Marshmallow
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

929 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now