Testing for Null Values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bhujanga
    New Member
    • Aug 2006
    • 44

    Testing for Null Values

    I have a form where the user enters various fields of information. Some of these fields may be left blank until a point in time when the user is ready to issue a permit. At that time they will click a button that unleashes a sequence of events that ultimately results in the aforemntioned permit being issued. The first events is a data checking routine, to make sure that all the values are appropriate for this action. I'm able to test most things quite easily. However when a field is null and I use the following syntax:

    If Me![OwnerNo] Is Null Then
    MsgBox "You must enter a valid Sign Owner before issueing a permit."
    Exit Sub
    End If

    It reurns the message "Object Required", while the following command works fine:
    If Me![NewStatus] = "I" Then
    MsgBox "You must change the status to something other than 'Illegal' before issueing a permit."
    Exit Sub
    End If

    What gives?

    Also, Is it not possible to assign background colors to tab pages?

    Thanks!
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    The proper syntax in VBA is

    If IsNull(Me.OwnerNo) Then

    Linq ;0)>

    Comment

    • Bhujanga
      New Member
      • Aug 2006
      • 44

      #3
      That's what I needed. Thanks

      Comment

      • missinglinq
        Recognized Expert Specialist
        • Nov 2006
        • 3533

        #4
        Glad we could help! BTW, the inverse syntax in VBA would be:

        If Not IsNull(YourFiel dName) Then

        Linq ;0)>

        Comment

        Working...