access- dynamic select query

  • Thread starter Thread starter subhadrasn
  • Start date Start date
S

subhadrasn

hai,
I hav database table with 17 fields.While retrieving data, user
must be able to select any of the 17 fields ( it can be 1 or more than
1 ), that is decided by the user at runtime.how should i write the
SELECT query for this one.I am a newbie to ms-access.
Please help me out..
 
hai,
I hav database table with 17 fields.While retrieving data, user
must be able to select any of the 17 fields ( it can be 1 or more than
1 ), that is decided by the user at runtime.how should i write the
SELECT query for this one.I am a newbie to ms-access.
Please help me out..

Probably the simplest way to allow this kind of flexibility is to create a
Form displaying all 17 fields, and show the user how to use the built-in Query
By Form feature.

You can also create a custom form and base a query upon it, with some VBA code
- but try starting with the builtin tool.

John W. Vinson [MVP]
 
Thanks for ur help, John.

But can u explain more on what u hav said..

Create a new Form based on your table.
Include all seventeen fields on the form, using textboxes, combo boxes,
checkboxes, or whatever as appropriate.

On the Menu select Records... Filter... Filter by Form.

Fill in search criteria in any combination of the controls and click the
Filter icon (looks like a funnel).

To restore to all records, click the filter icon again (it will be shown
"depressed" if the form is filtered).

John W. Vinson [MVP]
 
Thank u once again.
I tried it.It works fine.Instead of using the filterby form icon,is it
possible to code it..
i hav used textboxes. but if my search criteria results with more than
1 result,it displays only 1output.Is it possible to show the entire
result in single form (something similar to tabular form)........
 
Back
Top