Results 1 to 3 of 3
  1. #1
    botts121 is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    19

    A NULL Question

    When writing a statement with NULL, what is the opposite of NULL?



    Like if I was to write

    If City = Null Then City.Enabled = True Else City.Enabled = False

    If I wanted to switch that around, what could I use instead of NULL?

    If City = (Blank) Then City.Enabled = False Else City.Enabled = True


    Thanks,

    Matt

  2. #2
    pdouglas is offline Novice
    Windows XP Access 2002 (version 10.0)
    Join Date
    Jun 2009
    Posts
    12
    City <> NULL
    or
    if NOT(IsNULL(City)) Then

    Cavaet - I'm noticing that Access doesn't like to "Play Well" with Non-Variant types and IsNull(). Maybe it is just a local peculiarity.

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Just for the record, Null is defined as the absence of anything. Nothing is equal to Null including Null. That is why we have the IsNull() function.

    Code:
    If IsNull(Me.City) Then
       Me.City.Enabled = True
    Else
       Me.City.Enabled = False
    End If
    Or the reverse:
    Code:
    If Not IsNull(Me.City) Then
       Me.City.Enabled = False
    Else
       Me.City.Enabled = True
    End If

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

Similar Threads

  1. Replacing Null with 0
    By gilagain1 in forum Queries
    Replies: 5
    Last Post: 04-23-2009, 01:47 PM
  2. Numeric value out of range (null)
    By PPCMIS2009 in forum Queries
    Replies: 0
    Last Post: 02-03-2009, 11:01 AM
  3. Fill in Null values
    By Petefured in forum Queries
    Replies: 1
    Last Post: 10-06-2008, 12:54 PM
  4. HELP with NULL DateTime VALUES
    By lfolger in forum Programming
    Replies: 3
    Last Post: 03-28-2008, 02:33 PM
  5. Null vs New Record
    By jversiz in forum Access
    Replies: 2
    Last Post: 02-20-2008, 12:02 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