By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,745 Members | 1,957 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,745 IT Pros & Developers. It's quick & easy.

Undefined function 'Chr' in expression

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.