Link to home
Start Free TrialLog in
Avatar of Brogrim
BrogrimFlag for Ireland

asked on

Function not available in query expression

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.
Avatar of tbsgadi
tbsgadi
Flag of Israel image

Hi Brogrim,

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

Good Luck!

Gary
Brogrim,

If all else fails try decompiling
http://www.granite.ab.ca/access/decompile.htm

Gary
Avatar of Brogrim

ASKER

I have opened a module in design view and selected references

How do I check if there is one missing?
ASKER CERTIFIED SOLUTION
Avatar of tbsgadi
tbsgadi
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Brogrim

ASKER

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.
(°v°)