473,386 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Undefined function 'Chr' in expression

I converted an Access 97 db to Access 2002 db and I now get the following
error message when I try and run a query.

Thanks

Here's my query.

SELECT DISTINCTROW tblCo_Info.Co_id, [Co_Name] & Chr(13) & Chr(10) & [Adr1]
& IIf(Trim([Adr2])<>"",Chr(13) & Chr(10) & [Adr2],"") & Chr(13) & Chr(10) &
IIf(Trim([City])<>"",Trim([City]) & ", ","") & [State] & " " & [Zip] AS
Address, [F_name] & IIf(Trim([MI])<>""," " & Trim([MI]) & ". "," ") &
[L_Name] & Chr(13) & Chr(10) & [Title] & Chr(13) & Chr(10) &
IIf(Trim([Phone])<>"","Phone: " & Trim([Phone]) & Chr(13) & Chr(10),"") &
IIf(Trim([Fax])<>"","Fax: " & Trim([Fax]) & Chr(13) & Chr(10),"") &
IIf(Trim([email])<>"","E-mail: " & Trim([email]),"") AS Contact,
tblCo_Info.Co_id
FROM tblCo_Info
WHERE tblCo_Info.Co_id<>"AAA";
Nov 13 '05 #1
2 7925
Hi there,

I tried this query in Access 2002:

SELECT [LastName] & Chr(13) & Chr(10) & [FirstName] AS Name
FROM tblEmployees;

and it works fine. Suggest you do something similar. Break your select
statement down into smaller, more manageable pieces, get something very
simple to work, add fields to your query till it breaks.
Chr() is fine.

HTH -Linda

"paddy_nyr" <mp****@yahoo.com> wrote in message
news:2r*************@uni-berlin.de...
I converted an Access 97 db to Access 2002 db and I now get the following
error message when I try and run a query.

Thanks

Here's my query.

SELECT DISTINCTROW tblCo_Info.Co_id, [Co_Name] & Chr(13) & Chr(10) & [Adr1] & IIf(Trim([Adr2])<>"",Chr(13) & Chr(10) & [Adr2],"") & Chr(13) & Chr(10) & IIf(Trim([City])<>"",Trim([City]) & ", ","") & [State] & " " & [Zip] AS
Address, [F_name] & IIf(Trim([MI])<>""," " & Trim([MI]) & ". "," ") &
[L_Name] & Chr(13) & Chr(10) & [Title] & Chr(13) & Chr(10) &
IIf(Trim([Phone])<>"","Phone: " & Trim([Phone]) & Chr(13) & Chr(10),"") &
IIf(Trim([Fax])<>"","Fax: " & Trim([Fax]) & Chr(13) & Chr(10),"") &
IIf(Trim([email])<>"","E-mail: " & Trim([email]),"") AS Contact,
tblCo_Info.Co_id
FROM tblCo_Info
WHERE tblCo_Info.Co_id<>"AAA";

Nov 13 '05 #2
On Fri, 17 Sep 2004 15:09:56 -0400, paddy_nyr wrote:
I converted an Access 97 db to Access 2002 db and I now get the following
error message when I try and run a query.

Thanks

Here's my query.

SELECT DISTINCTROW tblCo_Info.Co_id, [Co_Name] & Chr(13) & Chr(10) & [Adr1]
& IIf(Trim([Adr2])<>"",Chr(13) & Chr(10) & [Adr2],"") & Chr(13) & Chr(10) &
IIf(Trim([City])<>"",Trim([City]) & ", ","") & [State] & " " & [Zip] AS
Address, [F_name] & IIf(Trim([MI])<>""," " & Trim([MI]) & ". "," ") &
[L_Name] & Chr(13) & Chr(10) & [Title] & Chr(13) & Chr(10) &
IIf(Trim([Phone])<>"","Phone: " & Trim([Phone]) & Chr(13) & Chr(10),"") &
IIf(Trim([Fax])<>"","Fax: " & Trim([Fax]) & Chr(13) & Chr(10),"") &
IIf(Trim([email])<>"","E-mail: " & Trim([email]),"") AS Contact,
tblCo_Info.Co_id
FROM tblCo_Info
WHERE tblCo_Info.Co_id<>"AAA";


You probably have a missing reference on the change over to 2002.

Open any module in Design view (or click Ctrl + G).
On the Tools menu, click References.
Click to clear the check box for the type library or object library
marked as "Missing:."

An alternative to removing the reference is to restore the referenced
file to the path specified in the References dialog box. If the
referenced file is in a new location, clear the "Missing:" reference
and create a new reference to the file in its new folder.

See Microsoft KnowledgeBase articles:
283115 'ACC2002: References That You Must Set When You Work with
Microsoft Access'
Or for Access 97:
175484 'References to Set When Working With Microsoft Access' for
the correct ones needed,
and
160870 'VBA Functions Break in Database with Missing References' for
how to reset a missing one.

For even more information, see
http://members.rogers.com/douglas.j.steele/AccessReferenceErrors.html
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ronald W. Roberts | last post by:
I'm not sure where this routine came from, but here is the problem. On certian computers this error occurs, but it does not on others. The error is: "Undefined Function "DIR" in expression". ...
12
by: Baldy | last post by:
really tricky one here. I want to be able to call a function but the function name is in a variable. The code is a security module that is querying a table that stores names of functions, forms,...
3
by: Mantorok Redgormor | last post by:
In this context would an indeterminate value lead down the path to undefined behavior? (void)foo->member; I want to keep my interface consisent in my program so I have this one function which...
12
by: RoSsIaCrIiLoIA | last post by:
On Mon, 07 Feb 2005 21:28:30 GMT, Keith Thompson <kst-u@mib.org> wrote: >"Romeo Colacitti" <wwromeo@gmail.com> writes: >> Chris Torek wrote: >>> In article <4205BD5C.6DC8@mindspring.com> >>>...
10
by: Michael B Allen | last post by:
I have some code: *str++ = tolower(*str); that gcc is complaining about: warning: operation on `str' may be undefined I'm getting similar warnings for 'di' and 'bi' in:
14
by: avsharath | last post by:
In "Bjarne Stroustrup's C++ Style and Technique FAQ" at: http://www.research.att.com/~bs/bs_faq2.html#evaluation-order for the statement: f(v,i++); he says that "the result is undefined...
12
by: Rajesh S R | last post by:
Can anyone tell me what is the difference between undefined behavior and unspecified behavior? Though I've read what is given about them, in ISO standards, I'm still not able to get the...
1
by: lmj24 | last post by:
Hi, I am using MSAccess 2002 Windows 2000 (stop laughing!) I am trying to use a function to generate a string in a textbox on a form. I can't use expression builder because the expression is too...
33
by: coolguyaroundyou | last post by:
Will the following statement invoke undefined behavior : a^=b,b^=a,a^=b ; given that a and b are of int-type ?? Be cautious, I have not written a^=b^=a^=b ; which, of course, is undefined....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.