Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8819167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:17:17+00:00 2026-06-14T05:17:17+00:00

I am confused on the conditional operators of VBA. It probably has something to

  • 0

I am confused on the conditional operators of VBA. It probably has something to do with weird type casting, but I am stuck and need some help –

query = "SELECT * FROM [records_table] " & _
    "WHERE [po_number] = " & Chr(39) & po_number & Chr(39) & ";"

Set rec_set = data_base.OpenRecordset(query)
MsgBox rec_set.Fields("po_ack")
If rec_set.Fields("po_ack") <> Null Then _
    po_ack = True
If rec_set.Fields("po_ack") = Null Then _
    po_ack = False

Now, this is supposed to return true, but it returns false? When I msgbox the record set value, I get “11/12/2012”, but when I msgbox the return of the function, it is false?

po_ack stores a Date value, and the value of this particular one is “11/12/2012”, so why when I check it against null, it says that “11/12/2012” == null?

Thanks in advance for any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:17:18+00:00Added an answer on June 14, 2026 at 5:17 am

    Null is never equal to anything, not even another Null.

    Null is never not equal to anything, not even another Null.

    Use the IsNull() function to check whether something is Null.

    If IsNull(rec_set!po_ack) = False Then
        po_ack = True
    Else
        po_ack = False
    End If
    

    See if the IsDate() function could be useful for what you want to do. Here are some sample expressions copied from the Immediate window.

    ? IsDate(Null)
    False
    ? IsDate(Now())
    True
    ? IsDate("2012-11-12")
    True
    ? IsDate("No way, dood")
    False
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Getting confused and stuck on syntax for a rewrite rule. Need to allow for
For some context, the conditional is used in the normal type of algorithm for
confused - given a track uri, I can get one album but possibly more
Bit confused here, I have an on-demand instance but do I get charged even
I am trying to use the conditional operator, but I am getting hung up
I am seeing something odd with storing doubles in a dictionary, and am confused
ok, this seems like it should be really simple but Im a bit confused:
I am a little confused here. I would like to do something like this:
Confused here... I have two dates which I NSLog to console and get: dates
Mildly confused. I have a combobox that is databound to a list of strings.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.