|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am working on a database for contract managment and having a problem. Users should be allowed to search various key terms (fields in a table) and pull up all records (on a report) that match with criteria entered. I do not want to use parameter values and want users to enter data on a form, push a button to run the query and send it to a report. I can make this work when I have parameters, I, however do not want this, I want users to enter search criteria on a form.
Any help would be greatly appreciated!! |
|
#2
|
|||
|
|||
|
Set the criteria on your query to reference the fields on your form. IE:
[forms]![formname]![fieldname] When you run the query, it will look at the values of those fields and use them as the query criteria.
__________________
--Slaughter slaughter@mizzou.edu |
|
#3
|
|||
|
|||
|
Thanks!! I got it working for one piece of criteria, but need it more multiple. The user can enter up to 16 pieces of info, I have been doing the same thing for all fields in the query, but it is still not working. I am assuming the SQL statement should have OR in it to account for blank fields.
So any help on searching by multiple criteria? Text boxes and combo boxes?? Thanks. |
|
#4
|
|||
|
|||
|
You can set the OR condition by setting each piece of criteria on a new line in the query.
Criterion set next to one another create an AND condition and criterion set on seperate lines create an OR condition. |
|
#5
|
|||
|
|||
|
Thanks!! Got it working, the only thing is it is not bringing back duplicates when there are many of a field, for example - all people will last name smith, it is only bringing one record...any suggestions...I do not have a distinct clause there...
thanks!! |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Search Criteria on a Form? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|