Solved

VB6 check date filed

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
count8 challlenge 13 85
array6 challenfge 6 62
topping1 challenge 7 50
advertisement module in core php 4 87
A short article about a problem I had getting the GPS LocationListener working.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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…

707 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

16 Experts available now in Live!

Get 1:1 Help Now