Results 1 to 4 of 4
  1. #1
    charly.csh is offline Competent Performer
    Windows 8 Access 2007
    Join Date
    Nov 2014
    Posts
    186

    Conditional IF for empty fields with no dates

    Hello everyone,



    Maybe my question is little simple this time, but how should be the correct statement for a "field date" as empty I mean


    I want to get this.... "If Me.Date_Real = "" Then MsgBox "Good"


    This is not making nothing and I understand maybe it the wrong statement but how should be it corrected?

    ********************************

    If Me.DateReal <> "" Then


    Dim MessageBox As Integer


    MessageBox = MsgBox("Do you want to close", vbYesNo, "Q-Tool ***Actions")


    If MessageBox = vbYes Then


    Me.Status = 1


    ElseIf MessageBox = vbNo Then


    Me.DateReal = ""


    End If


    End If



    Thanks for the support!!!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    To test for no date:

    If Not IsDate(Me.DateReal) Then

    You could also test for Null

    If IsNull(Me.DateReal) Then
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    charly.csh is offline Competent Performer
    Windows 8 Access 2007
    Join Date
    Nov 2014
    Posts
    186
    Great!
    That was the solution!

    Thanks!!!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Conditional Formating for Dates
    By JoeJr in forum Programming
    Replies: 1
    Last Post: 10-02-2019, 07:19 PM
  2. Conditional formatting for a empty field
    By Bradex in forum Forms
    Replies: 4
    Last Post: 03-18-2016, 09:11 PM
  3. Replies: 2
    Last Post: 04-23-2012, 10:13 PM
  4. Replies: 4
    Last Post: 11-20-2011, 01:08 PM
  5. Using Conditional Formatting & Dates
    By djclntn in forum Forms
    Replies: 14
    Last Post: 04-12-2011, 07:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums