Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / June 2006

Tip: Looking for answers? Try searching our database.

Interactive query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DeanL - 05 Jun 2006 21:49 GMT
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...
pietlinden@hotmail.com - 06 Jun 2006 03:53 GMT
> Hi all,
>
[quoted text clipped - 9 lines]
>
> 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.
pietlinden@hotmail.com - 06 Jun 2006 05:14 GMT
> > Hi all,
> >
[quoted text clipped - 5 lines]
> > 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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.