Results 1 to 5 of 5
  1. #1
    Join Date
    May 2009
    Posts
    12

    Unanswered: Invalid use of Null - Don't want it to display MsgBox

    My user interface uses a series of combo boxes to filter the particular data a user is going to edit add records to etc.

    However, when a user doesn't make a selection or makes a type-o that doesn't filter to an index i get the standard MsgBox for "Invalid use of Null"

    Doesn't crash the system or do anything bad but gets annoying to have to click the 'ok' button each time.

    Is there a way to handel this error and then not display the MsgBox?

    Thank you have and good weekend,

    dBresilience

  2. #2
    Join Date
    Mar 2007
    Posts
    277
    Do you have error handling included in your procedure?
    RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP, ac07, ac10 - WinXP Pro, Win7 Pro
    Please reply to this forum so all may learn.

  3. #3
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Use the Nz function to replace Null by something harmless:
    Something = Nz(Me.Combo_X.Value, "")

    Have a nice day!

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    ▲ What he said.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  5. #5
    Join Date
    May 2009
    Posts
    12
    thank you for the help

    Using your suggestion i educated myself further on the matter, for others that have questions this helped:

    Nz Method*[Access 2007 Developer Reference]

    Thank you again,

    dbresilience

Posting Permissions

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