Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jul 2002
    Location
    Kitchener, Ontario, Canada
    Posts
    57
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Case Null (2000 SP3)

    I have a select case as follows:

    Select Case Me.Woodstove1Type
    Case Null
    intWS1Cnt = 0
    Case "Other"
    intWS1Cnt = 0
    Case "None"
    intWS1Cnt = 0
    Case Else
    intWS1Cnt = 1
    End Select

    When I step through the code Woodstove1Type is Null but it drops into Case Else and intWS1Cnt ends up equal to 1 instead of 0. What am I doing wrong?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Case Null (2000 SP3)

    Null is not really a value, you will have to test for Null separately, before the Select Case statement:

    If IsNull(Me.Woodstove1Type) Then
    ...
    Else
    Select Case Me.Woodstove1Type
    ...
    End Select
    End If

  3. #3
    Star Lounger
    Join Date
    Jul 2002
    Location
    Kitchener, Ontario, Canada
    Posts
    57
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Re: Case Null (2000 SP3)

    Thanks, Hans... worked like a charm!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •