Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6975645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:23:42+00:00 2026-05-27T17:23:42+00:00

I am working in Access 2010. I am building a database that lets my

  • 0

I am working in Access 2010.

I am building a database that lets my organization catalog blank walls in the city — including their location, what way they face, whether the adjacent lot is vacant or occupied, etc. This information is stored in a table called WallsMaster.

This is my query.

SELECT WallsMaster.StreetAddress, WallsMaster.Zip, WallsMaster.Direction, WallsMaster.LotInfo

FROM WallsMaster

WHERE 

(
((WallsMaster.Zip) Like "*" & [Forms]![Search_Form]![Zip_Search] 
Or 
(WallsMaster.Zip)="" 
Or 
(WallsMaster.Zip) Is Null)

AND 

((WallsMaster.Direction) Like "*" & [Forms]![Search_Form]![Direction_Search] 
Or 
(WallsMaster.Direction)="" 
Or 
(WallsMaster.Direction) Is Null)

AND 

((WallsMaster.LotInfo) Like "*" & [Forms]![Search_Form]![LotInfo_Search] 
Or 
(WallsMaster.LotInfo)="" 
Or 
(WallsMaster.LotInfo) Is Null)
)
;

When I enter a value for Zip but leave the other parameters blank, what I want is all Direction & LotInfo values (including nulls/blanks) for that zip only (not including nulls/blank Zip values) . When I enter Direction but leave the others blank, I want all Zip and LotInfo values (including nulls/blanks) for that Direction (not including null/blank Direction values) , and so on for LotInfo.

What I’m getting when I do this includes nulls/blanks for the
parameters I’ve left blank but also includes nulls/blanks for the
field I’ve indicated a search parameter for.

ie, if I search for Zip 19130 and leave Direction & LotInfo blank, I get this:

Address,Zip,Direction,LotInfo
123 Main St, 19130, South, Vacant
456 Elm St, , North, Vacant
789 Fake St, 19130, , ,
321 K St, 19130, East, Occupied

What I want is this:

Address, Zip, Direction, LotInfo
123 Main St, 19130, South, Vacant  
789 Fake St, 19130, , 
321 K St,19130, East, Occupied
  1. How can I re-write my SQL script to give me the results I want?
  2. For the sake of this example, I’m just sharing a few fields. My real WallMaster table has about 30 fields and hundreds of records and I want my search form to search by any/all of these fields at a time. Is this the most efficient way to write this search?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:23:42+00:00Added an answer on May 27, 2026 at 5:23 pm

    Regarding your second question, I personally wouldn’t bother writing a query to filter every conceivable combination of values that you envisage.

    Here is a great example from Allen Browne showing how to implement a search form. I have used this in the past and it works brilliantly, however this was back in the day when Access 2003 was the only available option.

    This solution soon becomes unwieldy if you need to add more fields to your table or the business rules change slightly.

    Instead, just load your data into a datasheet and utilize the automatic filtering that Microsoft access 2010 offers you out of the box. You will be able to filter all columns in any combination you wish and this will even work if you add new fields to your table (providing the forms data source is set up correctly)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a new application that uses a jet (MS Access) database.
I am working on my first Access 2010 database and have run into a
I’m working with Access 2010. I’m developing a database for a public art program
I am working on an Access adp that has its data stored in sql-server.
I'm working with an old Access database (yes, it's very ugly and I hate
I am working on a database access layer project and decided to use Linq
I'm working on a WCF service that requires Membership and Profile access. I got
I have an application in Access 2003 that I am working on. In it,
I am working on a project with MS Access 2010. A person with an
I'm working with a program that accesses an MS-Access DB. The problem is that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.