Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 357
  • Last Modified:

VB6 check date filed

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
tesla764
Asked:
tesla764
  • 2
  • 2
1 Solution
 
advfinanceCommented:
Can you post your screenshot as an image? I can't view docx files on my phone.

--
Chris
0
 
tesla764Author Commented:
Here's a jpg.
Screen-Shot.JPG
0
 
advfinanceCommented:
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
 
tesla764Author Commented:
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now