If then In a query Statement

dgaller

Registered User.
Local time
Today, 06:24
Joined
Oct 31, 2007
Messages
60
I am stumped and need some help I have a simple select query used in a combo box to filter what is shown. As shown below.

SELECT [Task Type Drop].[Task Type Id], [Task Type Drop].[Task Type], [Task Type Drop].[Task Category], [Task Type Drop].[Task Type Definition]
FROM [Task Type Drop]
WHERE ((([Task Type Drop].[Task Category])=[Forms]![Task Category and Area Look up]![Combo158]))
ORDER BY [Task Type Drop].[Task Type];


Is is possible to only have it use the criteria if a nother field [Combo158] is not null?

Simply put I would like it to be if [Combo158] is null

SELECT [Task Type Drop].[Task Type Id], [Task Type Drop].[Task Type], [Task Type Drop].[Task Category], [Task Type Drop].[Task Type Definition]
FROM [Task Type Drop]
ORDER BY [Task Type Drop].[Task Type];


If not null

SELECT [Task Type Drop].[Task Type Id], [Task Type Drop].[Task Type], [Task Type Drop].[Task Category], [Task Type Drop].[Task Type Definition]
FROM [Task Type Drop]
WHERE ((([Task Type Drop].[Task Category])=[Forms]![Task Category and Area Look up]![Combo158]))
ORDER BY [Task Type Drop].[Task Type];
 
Can't get much simpler than that. It worked thanks!
 

Users who are viewing this thread

Back
Top Bottom