VBA Not IsNull

conditionalms-accessvba

Working with some VBA code in Access that when a very specific set of conditions are met it will pop up an InputBox asking for a integer. So far so good.

Private Sub Command10_Click()

    If Not IsNull(mrf) Then
        If min <> max Then
            If qty <= min Then
                mrf = GetParamValue
            End If
        End If
    End If
    End Sub

The problem is that the Not IsNull seems to be ignored. I would like it to ask for a value to be entered unless a value is already present. This keeps firing off the InputBox as long as the min <> max and qty <= min conditions are met. What am I missing here?

Best Solution

If mrf is Variant, then it's initially Empty, not Null. You therefore have to use IsEmpty() function.

Related Question