We help IT Professionals succeed at work.

Function not available in query expression

Brogrim asked
Medium Priority
Last Modified: 2012-05-06
I have put an application on to a different PC and am now getting teh following mesage when I try to open up some of the forms. the full error message is :

Function not available in query expression 'Trim(Trim(Trim(Trim(Trim(Trim(Trim(Trim(nz([HouseNo],"") & nz([HouseLetter],"")) & " " & nz([HouseName],"")) & " " & nz([Address1],"")) & " " & nz([Address2],"")) & " " & nz([Address3],"")) & " " & nz([County],"")) & " " & nz([PostCode],"")) & " " & nz([PostCodePrefix],""))

It is working fine on other PC's, any ideas thanks in advance.
Watch Question

Hi Brogrim,

Check your references that nothing is missing.
Then check that you have the same service packs.

Good Luck!



If all else fails try decompiling

BrogrimInformation Systems Development Manager


I have opened a module in design view and selected references

How do I check if there is one missing?
It will say missing by one of the ticked references

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
BrogrimInformation Systems Development Manager


There was no missing in front of any of the referneces, I ticked on a few active x references and it worked.

Glad to help!

As a side note, you shouldn't use VB function calls in a query when you can avoid it. Your expression is equivalent to:

(HouseNo & HouseLetter)+' ' & HouseName+' ' & Address1+' ' & Address2+' ' & Address3+' ' & County & ' '+PostCode & ' '+PostCodePrefix

Which doesn't use VB at all. Note: "xx" & Field1 & "yy" returns "xxyy" when Field1 is Null (so you really don't need all those Nz() calls); "xx"+Field1 returns "xxabc" when Field1 contains "abc", and Null when Field1 is Null. This is how the trick with the spaces and the mix of & and + works.

This being said, the issue needs to be resolved anyway: there is something wrong with that particular installation.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.