Solved

In my Access 2003 application, I get the following error when I execute a query: Function is not available in query expression and I don't know why?

Posted on 2013-01-26
2
404 Views
Last Modified: 2013-01-27
I am executing an Access application using Access 2003.
I run the following query:

qry6OpendItemsAppendWRS which is defined as follows:

INSERT INTO tblOpenItems ( Bank, Office, checkNum, refNo, [trans date], Type, [process date], Pending, AgeDays, T, Description, amount, UserID, AuditDate, footnote, responsibility, rptID, [REPORT NAME] )
SELECT qry5CreateOpenItemsWRS.bankNum, qry5CreateOpenItemsWRS.office, qry5CreateOpenItemsWRS.checkNum, qry5CreateOpenItemsWRS.refNum, qry5CreateOpenItemsWRS.Expr2, qry5CreateOpenItemsWRS.transType, qry5CreateOpenItemsWRS.Expr3, qry5CreateOpenItemsWRS.pending, qry5CreateOpenItemsWRS.Expr4, qry5CreateOpenItemsWRS.cr_db, qry5CreateOpenItemsWRS.descr, qry5CreateOpenItemsWRS.Expr5, qry5CreateOpenItemsWRS.userID, qry5CreateOpenItemsWRS.auditDt, qry5CreateOpenItemsWRS.Expr6, qry5CreateOpenItemsWRS.Expr7, qry5CreateOpenItemsWRS.rptID, qry5CreateOpenItemsWRS.[REPORT NAME]
FROM qry5CreateOpenItemsWRS;

I get the following error:

Runtime error '3075'

Function is not available in query expression
'IIf(isnumeric(clientacct),left(clientacct,3),"")'.
----------------------------------------------------------

qry5CreateOpenItemsWRS is defined as follows:



SELECT OI_WRS.bankNum,
IIf(isnumeric(clientacct),left(clientacct,3),"") AS office,

IIf(isnumeric(clientacct),right(clientacct,6),clientacct) AS checkNum,

OI_WRS.refNum, OI_WRS.transMnth & "/" & OI_WRS.transDay & "/" & OI_WRS.transYr AS Expr2, OI_WRS.transType, OI_WRS.procMnth & "/" & OI_WRS.procDay & "/" & OI_WRS.processYr AS Expr3, OI_WRS.pending, OI_WRS.age*1 AS Expr4, OI_WRS.cr_db, OI_WRS.descr, IIf(sign="-",CDbl(OI_WRS.amount*(-1)/100),CDbl(amount)/100) AS Expr5, OI_WRS.userID, OI_WRS.auditDt, " " AS Expr6, " " AS Expr7, tblBanks.rptID, tblBanks.[REPORT NAME]
FROM OI_WRS INNER JOIN tblBanks ON OI_WRS.bankNum=tblBanks.[Bank Code];
0
Comment
Question by:zimmer9
2 Comments
 
LVL 22

Assisted Solution

by:Kelvin Sparks
Kelvin Sparks earned 250 total points
ID: 38823452
Generally, this error occurs if you have a brokne reference in VBA. Goto any VBA windows, click tools, REferences and see if any of the ones that are ticked have the worg MISSING after then. Resolve that problem and you should be away OK.


Kelvin
0
 
LVL 61

Accepted Solution

by:
mbizup earned 250 total points
ID: 38823458
If that doesn't help,  check your Macro Security settings.   I believe a setting of 'high' will prevent VB expressions from running in property sheets and queries in Access 2003.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question