|
BeTheBall -> RE: Conditional Search Form like Access (1/12/2006 20:43:40)
|
What I would do is use one text box. Then add a group of radio buttons where the user marks the field he or she wishes to search by. So, say for example your text box is named, T1. You add a radio button group that would look something like this: <input name="r1" type="radio" value="field1"> <input name="r1" type="radio" value="field2"> <input name="r1" type="radio" value="field3"> You name each button the same name, but the value should match the names of the db fields you may be searching. Then your SQL becomes something like this: SELECT * FROM tblName WHERE ::r1:: = '::t1::' The above will work perfectly if all the db fields are text datatypes. If not, we will need to tweak this idea somewhat. Now, keep in mind this approach allows the user to search on any field they choose from the radio buttons, but they can only search on one field, not a combination of fields. However, it sounds like perhaps that would meet your needs. By the way, if you check my avatar carefully you will see that I am THE one man gopher show! [:D]
|
|
|
|