Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 15th, 2006, 07:34 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to leehambly
Default

This is where you start getting into it now...

How many criteria (criterium?) do you have?
Maybe a form for the user to enter the data on would be preferable, then they wont have to keep entering data into the little dialog boxes.

You can reference the fields on a form in the same way as you are with the [Type the phrase of letters you are looking for:], you are currently using.

The format is:

Forms!<formName>!<formControl>

So, if you have a form named: frmSearch
And on that form you have a textbox named: txtProjectName

You would use: Forms!frmSearch!txtProjectName in your query.

So, you need to open the form first and then enter the data in the text box and then run the query.

You could, I suppose, then run 20 queries (against each of your tables) with all of the queries pointing tot he same textbox - I still suggest you combine all your data though!

The way to get around the user not putting any data in the textbox and still wanting the query to show the results is to put the following, though this may start confusing you:

Forms!frmSearch!txtProjectName or Like Forms!frmSearch!txtProjectName is null

It needs both parts of the statements, including the or and the like and the is null!

Food for thought, and I am skimming over so much, I think you should invest in a book... I'm not on commission!
 
Old December 15th, 2006, 07:40 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to leehambly
Default

Sorry, should have answered your question...

Yes it is possible to do more than one. Simply put in more than one. If the criteria are on the same horizontal line then you will be looking for both criteria (AND). If you want one or the other of the criteria to be true, then you should put them on different lines (OR).

Note: each of your criteria will need a different phrase, or it will take the input data for both!

I think a form is a better solution though!
 
Old December 15th, 2006, 07:45 AM
Authorized User
 
Join Date: Dec 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sorry for troubling you :P

WHERE ((([PROJECTNAME].FIELD1) Like "*" & [Type the phrase of letters you are looking for:] & "*") AND (([PROJECTNAME].FIELD2) Like "*" & [Type the phrase of letters you are looking for:] & "*"))

I this ****er is only missing just a small fix somewhere to make the second one prompt incase the first oen is empty,

Can I make variables or "if" sentences in this programing language :S ?

 
Old December 15th, 2006, 07:46 AM
Authorized User
 
Join Date: Dec 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ohh, sorry late reading your answer leehamb :P love <3






Similar Threads
Thread Thread Starter Forum Replies Last Post
Search button doesn't search Access DB cbones Visual Studio 2008 1 October 27th, 2008 07:36 PM
File Search / Indexing Search with .net 2.0 maulik77 ASP.NET 1.0 and 1.1 Basics 2 March 15th, 2007 12:45 AM
Regarding Search Tool in ASP Page.Urgent Help Need anand_asv Classic ASP Basics 2 February 7th, 2006 05:03 AM
Search Engine for Full-text Search Kala ASP.NET 1.0 and 1.1 Professional 2 August 29th, 2004 02:16 AM
Search engine that search through local drive! wenzation Classic ASP Basics 0 August 26th, 2003 09:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.