Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 4th, 2004, 01:12 PM
rs8439 rs8439 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 37 rs8439 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Unhappy Search Criteria on a Form?

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!!

Reply With Quote
  #2  
Old February 4th, 2004, 03:06 PM
Iraq n Baq Iraq n Baq is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Columbia, Missouri
Posts: 34 Iraq n Baq User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 34 m 50 sec
Reputation Power: 5
Send a message via AIM to Iraq n Baq
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

Reply With Quote
  #3  
Old February 4th, 2004, 04:09 PM
rs8439 rs8439 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 37 rs8439 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
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.

Reply With Quote
  #4  
Old February 4th, 2004, 04:14 PM
Iraq n Baq Iraq n Baq is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Columbia, Missouri
Posts: 34 Iraq n Baq User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 34 m 50 sec
Reputation Power: 5
Send a message via AIM to Iraq n Baq
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.

Reply With Quote
  #5  
Old February 4th, 2004, 04:23 PM
rs8439 rs8439 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 37 rs8439 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 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!!

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Search Criteria on a Form?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway