Search Criteria

amx

Registered User.
Local time
Today, 13:00
Joined
May 5, 2005
Messages
14
Hi,

I have a search query (query by form) which is picking up keywords from a form and displaying matching results.

I want to add a tick box to the form, and if this tick box is ticked, I want the search to only include results which have a certain field NOT blank.

ie.

frmSearch will have tick box named "Website"

If "Website" is ticked on the form and the QBF run, the query will only show those records which have information in the field "Website Address" in the table tblPublication.

If the "Website" tick box it NOT ticked, the query will show all records, regardless of having information in the field "website address" or not.

can i do this in the criteria of the query?

I don't really want to do it by having a seperate query which is run by a seperate "Search" button on the form - this would be possible by having a 2nd search button (titled "Search for results with website") run a different query which has the critera that the field "Website Address" is not null.

I dont really want to have a seperate button and query as it makes it a bit messy - would rather the one query look up if the tick box, and if "ticked" then display only those with content in "website address" field, and if not ticked, display all regardless of content of field "website address".

any ideas?!

Cheers

amx
 
Put this in a new column in the query grid in query Design View:-

-------------------------------------
Field: IIf([Forms]![frmSearch]![Website]=True, [tblPublication].[Website Address] Is Not Null, True)

Show: uncheck

Criteria: True
-------------------------------------
.
 
awesome, worked a treat thanks :)

amx
 

Users who are viewing this thread

Back
Top Bottom