Invalid use of Null

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CLSkcab
    New Member
    • Aug 2014
    • 26

    Invalid use of Null

    Frontend: MS Access 2010/VBA
    Backend: MS SQL Server 2008

    This code is used to determine the the current key (ID) of a table entry. When the table is empty however the following message is issued: Run-time error '94' Invalid use of null. How do I get around this?

    Code:
    Private Sub getID()
    
    Dim OldCaseNum As Integer
    OldCaseNum = DMax("ID", "[dbo_BWC]")
     
    End Sub
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Use the Nz() function to change the null to something else.

    Comment

    Working...