PDA

View Full Version : multiple query on several fields??



nathan2314
12-13-2008, 09:20 AM
Hello All :hi:
Does anyone know what the best way to do a query on multiple fields might be. I have several combo boxes on my form (like lastname, firstname, city, state, income, branchofmilitaryservice, rank etc etc..) that a user can select or type a value in. I also have a check box next to each of these combo boxes that a user can check if they want to include it in the search. So now I would like to take all the combo boxes that have a check in the check box and do a query on all the values in the combo boxes. The query would be doing a 'and' query. So if if the user selects the lastname, city, and rank fields I would want to do a query on all the data in my main table that matches the values they entered for "lastname" and "city" and "rank"...
Actually i would like to make the search ability really flexible so would also like to give them the option of doing 'or' query's also but that seems too big a step for me right now so I'm just focusing on the 'and' part for now. Unless someone knows a easy way to do both ??
Appreciate any help!!!:yes

OBP
12-13-2008, 09:46 AM
You can see an example of the Form and Query method similar to what you wan to do here

http://forums.techguy.org/software-development/749341-query-form.html

see the one attached to post #10.

nathan2314
12-13-2008, 11:21 AM
Ok Thank You...I will check it out! :)