By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,916 Members | 1,078 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,916 IT Pros & Developers. It's quick & easy.

Interactive query

P: n/a
Hi all,

I'm trying to create a form that will display the results of a query
that the user will decide on the fields searched. I need a form that
shows several fields, possibly in a list box or series of combo boxes
that the user can select the fields to search in. Then I need to use
the contents of one or more text fields that will contain the search
terms. Not all of the fields will be searched each time so how would I
go about setting this up?

Any help is greatly appreciated.

Many thanks, Dean...

Jun 5 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

DeanL wrote:
Hi all,

I'm trying to create a form that will display the results of a query
that the user will decide on the fields searched. I need a form that
shows several fields, possibly in a list box or series of combo boxes
that the user can select the fields to search in. Then I need to use
the contents of one or more text fields that will contain the search
terms. Not all of the fields will be searched each time so how would I
go about setting this up?

Any help is greatly appreciated.

Many thanks, Dean...


there's an example of a form with a textbox at the top and the results
of the sql query in a flexgrid (I think) in the lower portion of the
form. The only difference is that you'd have a field list (combobox
wizard will do this no problem) to get the fields to search. Then
you'd just OR the stuff together, generate your SQL statement, then set
the rowsource for the flexgrid.

Jun 6 '06 #2

P: n/a

pi********@hotmail.com wrote:
DeanL wrote:
Hi all,

I'm trying to create a form that will display the results of a query
that the user will decide on the fields searched. I need a form that
shows several fields, possibly in a list box or series of combo boxes
that the user can select the fields to search in. Then I need to use
the contents of one or more text fields that will contain the search
terms. Not all of the fields will be searched each time so how would I
go about setting this up?


Did you look at the SQL text/results table form in ADH?

I would start there and then maybe use a multi-select listbox to
collect fields to be listed and maybe a subform to collect fields and
values combinations to search. Something like...

<cboFieldList> <cboSymbol> <txtValue>
e.g. <tblLineItems.ItemID><"="><15>

and then you'd end up with...
SELECT...
FROM...
WHERE tblLineItems.ItemID=15;

then you'd assign the flexgrid control's rowsource to the query. (See
ADH).

Essentially, you'd just replace the textbox control with controls to
choose {FieldName, Operator, ComparisonValue}, and then generate the
SQL on the fly, and then assign it to the rowsource of the grid.

Confused? (So am I!!)

Pieter

Jun 6 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.