Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Apr 2001
    Location
    Guatemala City
    Posts
    515
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Procedure using Null

    I am using a Access 97 DB converted to 2010 The procedure functions in the first option, but the second option functions like it returns 1, rather than Null. Is the syntex correct for this?

    Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)
    ' Set the option group value to match user's filtering action.

    If ApplyType = acShowAllRecords Then
    FilterOptions = 1 ' Set the All Contacts option value.
    ElseIf Filter <> "City = 'New York'" Then
    FilterOptions = Null ' Don't set any option value.
    End If

    End Sub

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    So FilterOptions is the name of an Option Group on your form. I don't know why setting its value to Null does not work. Try setting it to 0 instead. Assuming 0 does not correspond to one of the options that makes it so none of the options are chosen.
    Regards
    John



  3. #3
    4 Star Lounger
    Join Date
    Apr 2001
    Location
    Guatemala City
    Posts
    515
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The 0 works. Thanks. Strange things do happen. I appreciate the help.

Posting Permissions

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