I take from your question that you are trying to write a stored procedure, if so then you may try this:
if (@cboLocId not null)
Begin
SELECT * FROM tblItem WHERE tblItem.LocId = @cboLocId
End
else
Begin
SELECT * FROM tblItem
end
GO
to know more from BOL:
IS [NOT] NULL
Determines whether or not a given expression is NULL.
Syntax
expression IS [ NOT ] NULL
Arguments
expression
Is any valid Microsoft® SQL Server™ expression.
NOT
Specifies that the Boolean result be negated. The predicate reverses its return values, returning TRUE if the value is not NULL, and FALSE if the value is NULL.
Result Types
Boolean
AL Almeida
NT/DB Admin
"May all those that come behind us, find us faithfull"