Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

filter recordset parameters not effective 1

Status
Not open for further replies.

shopwise

Technical User
Sep 22, 2008
52
US
WHERE Not IsNull(CustomText10) AND Not IsEmpty(CustomText10)


When using the above code in my recorset to eliminate any records where CustomText10 does not contain any value, I am not being successful. The records that contain no value are nevertheless being displayed.


I also tried adding:


AND CustomText10 <> ""


Apparently this latter code is not in the correct syntax as it is giving expected end of statement error message.
 
What about this ?
Code:
WHERE Trim(CustomText10 & "")<>""

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks for your response but when I did as suggested:

AND (CustomText10 & "")<>""

The error reads:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ... AND (CustomText10 & [)<>] ...

so
AND (CustomText10 & "")<>""
is being rendered as:
AND (CustomText10 & [)<>]
 
I didn't realize that Trim was a function, I thought you were indicating that you have trimmed some code. In any case, I have tried:

...AND Trim(CustomText10 & "")<>"".. but the same error occurs:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'CustomText10 <> 'N/A' AND Not IsNull(CustomText10) AND Not IsEmpty(CustomText10) AND Trim(CustomText10 & [)<>]
 
Any chance you could post the code building the SQL ?
My guess is to use this:
Code:
WHERE CustomText10<>'N/A' AND Trim(CustomText10 & '')<>''
With the above you don't need the IsNull and IsEmpty stuff.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top