Access 2003 to Access 2010

rnutts

Registered User.
Local time
Today, 11:26
Joined
Jun 26, 2007
Messages
110
The company I work for have recently upgraded PC's to Office 2010 from 2003. I am getting some errors in my database which I am dealing with one at a time.
The latest is when I run a particular report I am receiving an error saying
Undefined function 'Chr' in expression

Below is the expression
SiteAddress: [Name] & (Chr(13)+Chr(10)+[Address1]) & (Chr(13)+Chr(10)+[Address2]) & (Chr(13)+Chr(10)+[Address3]) & (Chr(13)+Chr(10)+[Town]) & (Chr(13)+Chr(10)+[tblsurveyenquiry].[County]) & (Chr(13)+Chr(10)+[Postcode])
If anyone can help, it would be much appreciated.

Thanks

Richard
 
You can switch the chr(13) + chr(10) to vbcrlf
chr no longer exists for some reason
 
Thanks for the reply, however when the query runs it now prompts me for the 'field' vbcrlf
Revised Expression below, any further help appreciated

SiteAddress: [Name] & [vbcrlf] & [Address1] & [vbcrlf] & [Address2] & [vbcrlf] & [Address3] & [vbcrlf] & [Town] & [vbcrlf] & [tblsurveyenquiry].[County] & [vbcrlf] & [Postcode]

I have tried removing the [] around vbcrlf but Access just puts them back in, hence the field prompt when run

Richard
 
SWAG here - could it be confused by [Name] ? Name is a reserved word in Access. (I do not have A2010 so cannot test)
 
I ran a quick query in Access 2010
Somefield: [Field1] & Chr$(13) & Chr$(10) & [Field2]

Worked perfectly......
vbcrlf didn't.

If you go back to your original SQL and change the structure does it work?

SiteAddress: [Name] & Chr(13) & Chr(10) & [Address1] & Chr(13) & Chr(10) & [Address2] & Chr(13) & Chr(10) & [Address3] & Chr(13) & Chr(10) & [Town] & Chr(13) & Chr(10) & [tblsurveyenquiry].[County] & Chr(13) & Chr(10) & [Postcode]
 
Short answer to your questions - No
I tried with the '+' changed to & - same error
I tried a new query as your suggestion with Chr$(10) and also Chr. I have even used the Function selector within the 'expression builder' and even then I get the error message.
I have just noticed that the Office 2010 installation has not been registered by our external support providers, when they get in at 9am I will get this looked at and then see if my problem disappears, as quite clearly 'Chr' is there as a function and available but I still get the problem.
I have even tried checking to see if any references are missing in VBA but - NO
Will check back later on this morning an advise how I am getting on.

Thanks for the help so far
 
I have got the activation of Office out of the way and I am still getting the error. So have removed Chr() from the query and used vbCrLf in VBA on the format event of the report, report now works.
Thanks for the help on the question
 

Users who are viewing this thread

Back
Top Bottom