Database Search. 1 Search box, to search multiple db fields

C

Chris

Hi,
We have a search page that connects to our Access Database. What we would
like to have is a search field, where the user can enter criteria. We would
like when the users hits the submit button, that the search will look into
multiple fields of the database.

So for example if they enter XX into the search field and hit submit. It
will bring up any results where XX is in either Field 1 and/or Field 2

Is this possible within FP2003? When I use the wizard, it creates 2
seperate search fields on the page. 1 for each field in the db, and this is
confusing for the user because they might not know which one to search?

Hope it's possible
Thanks
Chris.
 
J

Jon Spivey

Hi Chris,

You'd want a custom query in the wizard.
select * from table where (field1 = '::FormField::') or (field2 =
'::FormField::')

Cheers,
Jon
 
C

Chris

Hi Thanks for the code,

I just tried it, and it doesn't seem to be working the way I expected.
If both fields have a 1 word entry, and the search criteria matches that
word, then it will appear.

But if either field has a sentence, then nothing appears. How do I make a
search more of a wildcard? I should put a % somewhere right?
 
J

Jon Spivey

In that case yes, try it like this
select * from table where (field1 like ':%:FormField::%') or (field2 like
'%::FormField::%')

Cheers,
Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top