473,383 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Optional Search

Hello all,

I've just hit a brick wall. What I have is a form with a heap of tick
boxs and text box on it and down the bottom a subform with shows the
results. i also have a search button down the buttom as well.

Now what I'd like to be able to do is for the user to select and fill
as many fields as they see fit then hit search and it will show the
results in the subform down the buttom that comply to one or all of the
search critea.

The trouble i'm having is with the whole optional thing in the query..
the few thing i have tryed have just shown me null values.

If someone could help me it would be great.

Cheers

Mar 27 '06 #1
3 1665
Ok i don't know what the hell happened with this post... doubled up for
some reason.. sorry everyone

Mar 27 '06 #2
Wo********@hotmail.com wrote in
news:11**********************@i40g2000cwc.googlegr oups.com:
Hello all,

I've just hit a brick wall. What I have is a form with a heap
of tick boxs and text box on it and down the bottom a subform
with shows the results. i also have a search button down the
buttom as well.

Now what I'd like to be able to do is for the user to select
and fill as many fields as they see fit then hit search and it
will show the results in the subform down the buttom that
comply to one or all of the search critea.

The trouble i'm having is with the whole optional thing in the
query.. the few thing i have tryed have just shown me null
values.

If someone could help me it would be great.

Cheers

Since we don't know what you've tried, it's kinda difficult to
suggest alternatives.

I've found that the best way is to have the query return all
records and use the filter and filterOn properties of the form
(or subform) to limit the returned results.

You will need to use code to determine which checkboxes are
checked, which textboxes have text and generate the where clause
for the filter property.

--
Bob Quintal

PA is y I've altered my email address.
Mar 27 '06 #3
PCD
Why didn't you recommend to the OP to iterate through all the records in his
database, selecting only those that are in the recordset his form is based
on, checking each checkbox in each selected record and then doing the
filtering? This would satisfy the OP's requirements so in your way of
thinking it would be perfectly correct. And as you say, it is a well
documented technique which you endorse.

PCD

"Bob Quintal" <rq******@sympatico.ca> wrote in message
news:Xn**********************@207.35.177.135...
Wo********@hotmail.com wrote in
news:11**********************@i40g2000cwc.googlegr oups.com:
Hello all,

I've just hit a brick wall. What I have is a form with a heap
of tick boxs and text box on it and down the bottom a subform
with shows the results. i also have a search button down the
buttom as well.

Now what I'd like to be able to do is for the user to select
and fill as many fields as they see fit then hit search and it
will show the results in the subform down the buttom that
comply to one or all of the search critea.

The trouble i'm having is with the whole optional thing in the
query.. the few thing i have tryed have just shown me null
values.

If someone could help me it would be great.

Cheers

Since we don't know what you've tried, it's kinda difficult to
suggest alternatives.

I've found that the best way is to have the query return all
records and use the filter and filterOn properties of the form
(or subform) to limit the returned results.

You will need to use code to determine which checkboxes are
checked, which textboxes have text and generate the where clause
for the filter property.

--
Bob Quintal

PA is y I've altered my email address.

Mar 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ole S. Pedersen | last post by:
I have two tables: eg. a person-table (no nulls allowed), with an id and so on, and a person_course table (an intermediate table in a many-to many relationship between person table and courses...
13
by: William Ryan | last post by:
I just picked up a copy of John Robbins' debugging book and started to look at disassembled code. Anyway, I hate optional Parameters in VB, but I was checking them out to see what IL is created. ...
16
by: ad | last post by:
Does C#2.0 support optional parameters like VB.NET: Function MyFunction(Optional ByVal isCenter As Boolean = False)
6
by: Phil Lee | last post by:
Hi, I have added an optional nillable element to a schema like this - .... <xs:element minOccurs="0" maxOccurs="1" name="Id" type="xs:int" nillable="true"/> .... A class is generated from...
1
by: Woodies_46 | last post by:
Hello all, I've just hit a brick wall. What I have is a form with a heap of tick boxs and text box on it and down the bottom a subform with shows the results. i also have a search button down...
14
by: cody | last post by:
I got a similar idea a couple of months ago, but now this one will require no change to the clr, is relatively easy to implement and would be a great addition to C# 3.0 :) so here we go.. To...
1
by: Tookelso | last post by:
Hello, I would like to have a group of elements which are *required* in one context, but each one is *optional* in another context. For example: I have a configuration file which has a...
12
by: pamelafluente | last post by:
Hi guys, In the past I have used several time optional parameters in my function. But Now I am more inclined to think that they are more dangerous than useful, and probably better to be...
24
imrosie
by: imrosie | last post by:
Hello all experts, I'm a newbie and I tried, but unsuccessfully to make the Dlookup statement optional...Help. Here's my code: Private Sub Customer_ID_NotInList(newdata As String, Response As...
7
by: jamesclose | last post by:
My problem is this (apologies if this is a little long ... hang in there): I can define a function in VB.NET with optional parameters that wraps a SQL procedure: Sub Test(Optional ByVal Arg1...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.