Searching Records By Querys

D

dan.cawthorne

Hello All, Im Trying to improve my Query serach's i have in my
database,

the query works like this,

I Have created a wizard type form with 3 combo boxes, which are un
bound and cmbo_Estimator, cmbo_Type Cmbo _Status

The Query Is a Copy of the Projects table, and have the fields looking
at the unbound combo boxes on the form, and it works fine as long as
a value is selected on each combo,

But what i would like to happen is lets say i want to leave the
Cmbo_Type Blank then Click Search the but it comes back with no
results

So what im saying is that if a combo is left empty the search ignores
that combo and it shows all records with all types.

thanks

danny
 
K

KARL DEWEY

Try this --
[Forms]![YourFormName]![cmbo_Estimator] Or
[Forms]![YourFormName]![cmbo_Estimator] Is Null
 
D

dan.cawthorne

Try this --
  [Forms]![YourFormName]![cmbo_Estimator]  Or  
[Forms]![YourFormName]![cmbo_Estimator] Is Null

--
KARL DEWEY
Build a little - Test a little



Hello All, Im Trying to improve my Query serach's i have in my
database,
the query works like this,
I Have created a wizard type form with 3 combo boxes, which are un
bound and cmbo_Estimator, cmbo_Type Cmbo _Status
The Query Is a Copy of the Projects table, and have the fields looking
at the unbound combo boxes  on the form, and it works fine as long as
a value is selected on each combo,
But what i would like to happen is lets say i want to leave the
Cmbo_Type Blank then Click Search the but it comes back with no
results
So what im saying is that if a combo is left empty the search ignores
that combo and it shows all records with all types.
danny- Hide quoted text -

- Show quoted text -

Thanks for getting back intouch with your help, but this isnt actually
doing what i want,

If I Run the Query its still returning empty,

Ive Tried it on the Cmbo_Type Which only has to Values "Commercial and
Retail"

So the Search Would only Show Retail Projects By a Estimator between 2
dates which it does or user can do the same again but change the type
to commercial,

But what im trying to achieve is if the user would like to search via
an estimator and between two dates criteria but to show back
Commercial and Retails projects

By Leaveing the Cmbo_Type Blank of having a Vaule Called All how do i
do this?

Under the Type Field in the Query Ive tried

having "Commercial;Retail" in the OR Box and that seems to show every
project by all estimators and from the first project imputted to the
last one.

So any other Suggestions?

Dan
 
K

KARL DEWEY

Post your SQL.
--
KARL DEWEY
Build a little - Test a little


Try this --
[Forms]![YourFormName]![cmbo_Estimator] Or
[Forms]![YourFormName]![cmbo_Estimator] Is Null

--
KARL DEWEY
Build a little - Test a little



Hello All, Im Trying to improve my Query serach's i have in my
database,
the query works like this,
I Have created a wizard type form with 3 combo boxes, which are un
bound and cmbo_Estimator, cmbo_Type Cmbo _Status
The Query Is a Copy of the Projects table, and have the fields looking
at the unbound combo boxes on the form, and it works fine as long as
a value is selected on each combo,
But what i would like to happen is lets say i want to leave the
Cmbo_Type Blank then Click Search the but it comes back with no
results
So what im saying is that if a combo is left empty the search ignores
that combo and it shows all records with all types.
danny- Hide quoted text -

- Show quoted text -

Thanks for getting back intouch with your help, but this isnt actually
doing what i want,

If I Run the Query its still returning empty,

Ive Tried it on the Cmbo_Type Which only has to Values "Commercial and
Retail"

So the Search Would only Show Retail Projects By a Estimator between 2
dates which it does or user can do the same again but change the type
to commercial,

But what im trying to achieve is if the user would like to search via
an estimator and between two dates criteria but to show back
Commercial and Retails projects

By Leaveing the Cmbo_Type Blank of having a Vaule Called All how do i
do this?

Under the Type Field in the Query Ive tried

having "Commercial;Retail" in the OR Box and that seems to show every
project by all estimators and from the first project imputted to the
last one.

So any other Suggestions?

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top