INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Mega Search

Power Search Simply by leobaby
Posted: 15 Jun 02

Here's a really cool and easy way to make a power search.

1. Create a form with textboxes for your search fields. They should have a default value "*" for now. The form doesn't need a data source.

2. Create a query on the data source you wish to search. For each field you want searchable change the Criteria to something like this....
Like [Forms]![frmPowerSearch]![Criteria3]
When you run this query it will be the results of your search. Best part is, the search criteria can have wildcards such as search* (begins with) or *search* (contains), others too I think.

Of course you can put the query as a subform of your search form and have a button that either requeries it or sets the data source (which requeries).  such as...

frmPowerSearchResults.Requery
or
[Forms]![frmPowerSearch]![frmPowerSearchResults].Form.RecordSource = "qryPowerSearch"

: (
One problem with this method of searching is that null values have bad effects on the ability to search a record. I think a null anywhere in the record causes it to get skipped. In the query you can just use an iif statement in the field: box (where the name of the column is usually displayed) like so....
IIf(IsNull([tblCustomers].[Customer])=True," ",[tblCustomers].[Customer])
Do this for every field that could be null.

Of course there are lots of things you can do to make this search more robust.

Enjoy
leobaby

Back to Microsoft: Access Forms FAQ Index
Back to Microsoft: Access Forms Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close