Formula help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NigelBrown
    New Member
    • Oct 2009
    • 34

    Formula help

    Hi All,

    This is prob easy but I have the below formula that is not working, how do I include an And statement within the IsNull to look at 2 combo boxes ? I have tried to do it a couple of ways but get the same error "Type Mismatch"

    [code=vb]

    If IsNull([ComboBox]) And ([ComboBox]) Then
    [ComboBox] = Null
    End If

    [/code]


    Thanks
  • ChipR
    Recognized Expert Top Contributor
    • Jul 2008
    • 1289

    #2
    IsNull only takes one parameter, so you'd have to do it twice.
    Code:
    If IsNull(control) And IsNull(otherControl) Then
      ...
    End If

    Comment

    • NigelBrown
      New Member
      • Oct 2009
      • 34

      #3
      Thanks ChipR - the only thing I did not try !!!!!
      Thanks again

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32668

        #4
        It's possible to use :
        Code:
        If IsNull(Control+OtherControl) Then
        ...
        End If
        but it is a little esoteric and relies on Null propagation.

        I'd actually recommend Chip's answer in most cases.

        Comment

        • ADezii
          Recognized Expert Expert
          • Apr 2006
          • 8834

          #5
          Originally posted by NeoPa
          It's possible to use :
          Code:
          If IsNull(Control+OtherControl) Then
          ...
          End If
          but it is a little esoteric and relies on Null propagation.

          I'd actually recommend Chip's answer in most cases.
          Getting esoteric on us, hey NeoPa! (LOL)!

          Comment

          Working...