Results 1 to 3 of 3
  1. #1
    thegrimmerdiscovery is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2017
    Posts
    30

    Search Box Run Time Error 94

    Hello people

    Absolute basic noob here. And I suspect that's being kind to myself.
    I'm using the code below for a search filter in a form. It's great apart from when the search criteria are effectively NULL.


    I've been reading around and understand that I need to handle this with the NZ function. Problem is I dont know where this NZ goes. Could someone tell me because nothing I'm trying works. Thanks.


    Private Sub SearchbyTitle_Click()

    Dim S As String
    S = InputBox("Title Name", "Title", Title)
    If S = "" Then Exit Sub
    Me.Filter = "Title LIKE ""*" & S & "*"""
    Me.FilterOn = True
    End Sub

  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Instad of
    If S = "" Then Exit Sub

    Use
    If (S & "") = "" Then Exit Sub

  3. #3
    thegrimmerdiscovery is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2017
    Posts
    30
    Brilliant. Thank you. That nailed it.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 12-12-2020, 07:31 PM
  2. Replies: 5
    Last Post: 08-29-2019, 04:25 PM
  3. Replies: 10
    Last Post: 07-07-2017, 05:11 PM
  4. Run time error 2465 on search form
    By Jims Chan in forum Forms
    Replies: 5
    Last Post: 01-05-2017, 04:00 AM
  5. Replies: 0
    Last Post: 07-16-2012, 05:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums