Blank fields issue to DBRW

  • Thread starter Thread starter Martin Stabrey
  • Start date Start date
M

Martin Stabrey

My search form has 5 fields (all drop-down lists) that are all
empty/blank to start with ie. the first option of each list is
<option></option> in the HTML. The user can select data from any of the 5
fields. Some fields may be left unfilled when the form is submitted to the
DBRW.
I am using the And comparison for each field - so, as an example, if the
user chooses an option from list 1 and an option from list 4, I would like
only the records that match and are common to both lists returned for
viewing.

My problem is that the fields that are left untouched by the user are being
queried along with the filled fields (which is the way it should work :-) )
I would like them to be ignored. Empty fields should not influence the query
at all.

How can I achieve this? Apologies for the nonDB speak. Quite raw at all of
this, but learning alot!

Mart
 
Hi Martin:
This article How to add an All Values item to a database query by using the
FrontPage 2003 Database Results Wizard
http://support.microsoft.com:80/kb/825453 might help. If the user doesn't
make a selection, it should use the All Values as the default.

--

~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
Expression Web Resources: http://www.spiderwebwoman.com/xweb/
FrontPage Resources: http://www.spiderwebwoman.com/resources/
Please reply to the newsgroup for the benefit of others
 
Hi Kathleen

Gee, you've certainly been a wealth of information! Thanks again for all
your help.

Unfortuantely, the "All Values" wildcard does exactly opposite of what I
want ie. I am needing to exclude a field from a query if no selection is
made.

I suppose what I need is a sort of "No Values" wildcard :-)

Thanks again.

Martin
 
Hi Martin:
I think if you think about, it would accomplish the same thing. Looking for
"All Values" of a field would give you the same results as not using the
field in your query. At least, it seems to me it's the same thing - but it
is only 6:15 in the morning and I've only had one cup of coffee. :-)

--

~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
Expression Web Resources: http://www.spiderwebwoman.com/xweb/
FrontPage Resources: http://www.spiderwebwoman.com/resources/
Please reply to the newsgroup for the benefit of others
 
I could certainly give that a go and see what happens.
As a matter of interest, do you know how this "All Values" is used in a text
field, as opposed to a drop down list?
I'm almost having my first glass of wine, being on the other end of the
world :-)

Mart
 
Back
Top