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
396 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
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now