where clause select all if empty

Posted on 2006-05-11
Last Modified: 2008-02-26
using 2.0 .... What i would like to do is create a search to my current page where if the person enters the search and it comes up empty all records will show instead of a blank table.

Is there something i can put in as the default value of the parameters property to make the default show all records or any other suggestions?  I am using an access database.
Question by:samme
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    where field = <search_value> OR <search_value> = '' or <search_value> IS NULL
    LVL 42

    Accepted Solution

    Generally you can do a "LIKE" search.

    If your sql is something like this:

    SELECT * FROM table WHERE UserName = (Parameter)

    Then change it to be like this:

    SELECT * FROM table WHERE Username LIKE (Parameter) & "*"

    This way if the parameter is blank you'll be selecting where LIKE * which will give you all records.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now