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