Results 1 to 2 of 2
  1. #1
    Onyx is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    3

    Filter query by user input and display all records if user enters no input


    I have created a query and have multiple tables, one of my fields is called [Department] and I have entered [Enter Department Name] as the criteria for that field. If i then type in the name of the Department i want to view it works great however sometimes it might be neccesary to show all departments therefore how can i code my expression to be able to show all records if the [Enter Department Name] is then left blank?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Try:
    Code:
    [Enter Department Name] Or Like [Enter Department Name] Is Null
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

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

Similar Threads

  1. Filter report by user input?
    By Kade in forum Reports
    Replies: 1
    Last Post: 04-01-2016, 12:42 PM
  2. Replies: 8
    Last Post: 09-17-2015, 09:57 PM
  3. Replies: 1
    Last Post: 11-04-2014, 12:07 PM
  4. Filter table in form by user input
    By swavemeisterg in forum Forms
    Replies: 1
    Last Post: 06-11-2012, 02:54 PM
  5. Display user input as Asterisk
    By 95DSM in forum Programming
    Replies: 2
    Last Post: 12-20-2010, 12:22 PM

Tags for this Thread

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