locked
How to check Null in a Combobox RRS feed

  • Question

  • Hi

    I need to check there is a value in a combobox.

    In one Form I have this code and it works:

        If (Eval("[Forms]![InventeringMalt]![Warehouse] Is Null")) Then
            Beep
            MsgBox "Please register the warehouse", vbOKOnly, """"
            End
        End If

    But when I try the same (simular) on another Form the code is ignored.

    I want this:

    On a MainForm I have a combobox "Warehouse"
    On the same MainForm there is a Pusbutton.
    If no Warehouse is selected I want a MsgBox "Please register the warehouse"

    I thought it was an easy one. But no success.

    Please help



    Cheers // Peter Forss Stockholm

    Wednesday, January 8, 2020 3:54 PM

Answers

All replies

  • You'd do something along the lines of

    If IsNull([Forms]![InventeringMalt]![Warehouse]) = True Then


    Daniel Pineault, 2010-2019 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    • Marked as answer by ForssPeterNova Wednesday, January 8, 2020 6:58 PM
    Wednesday, January 8, 2020 4:08 PM
  • Thanks Daniel!

    Two brackets missing

    If (IsNull([Forms]![InventeringMalt]![Warehouse]) = True) Then


    Cheers // Peter Forss Stockholm



    Wednesday, January 8, 2020 6:58 PM