Chr and Access 2010 Reports?

RoosterD

New member
Local time
Today, 14:59
Joined
Jun 17, 2011
Messages
4
Hello all, I have a feeling you'll be seeing a lot of me in the future, I hope that's a good thing. I just started working on our companies access database 2003. We're moving to office 2010 and I'm finding a number of issues that I need to fix.

Anyway, when printing a purchase order we have a print preview function that displays what will print which show up as a report. The code for the ship to address works fine in 2003:

=[Companies.CompanyName] & Chr(13) & Chr(10) & [Companies.Address1] & Chr(13) & Chr(10) & [Companies.City] & ", " & [Companies.Region] & " " & [Companies.PostalCode] & Chr(13) & Chr(10) & "Phone: " & [Companies.Phone1] & Chr(13) & Chr(10) & "Fax: " & [Companies.Fax]

However, in 2010 I get this very informative #Type! message. I've tried using vbCrLf and vbNewLine to no avail. Basically it thinks vbCrLf is a variable and adds [vbCrLf] to it. Then when I go into report view it asks for a value for the parameter. Any help is greatly appreciated! I've been at this for a while testing different things. I even tried <BR>...

Dave in Sacto
 
I can't see anything obviously wrong, so suggest you trouble shoot it like this:
Create a new report but change the ship to address to just one field - Companies.CompanyName - and get it working with just one field. Then add one more field and get it working with just those 2 fields. Continue adding one field and testing. Eventually you should find where the error is coming from and be able to fix it.
 
I can't see anything obviously wrong, so suggest you trouble shoot it like this:
Create a new report but change the ship to address to just one field - Companies.CompanyName - and get it working with just one field. Then add one more field and get it working with just those 2 fields. Continue adding one field and testing. Eventually you should find where the error is coming from and be able to fix it.

I did this, and it works great, but there are a couple of fields that are too long. In other words I can't get word wrap to work with out covering up other fields below. I was hoping there would be an easy answer. I'll keep at it. And thank you for your help!
 
In a report, you set the word wrap in a different way.
Choose the textboxes in the report and set their Can Grow and Can Shrink properties to suit.
 
maybe A2010 is more fussy about types. are any of these fields numbers - in which case maybe you need cstr(number) to turn them into a string.

.....
of course, jeanette is correct - you can probably do this for a textbox, but not for a label ... and it might be a problem if the text box is named the same as one of the fields.
 
maybe A2010 is more fussy about types. are any of these fields numbers - in which case maybe you need cstr(number) to turn them into a string.

There are numbers in the address, I'll play with this one too. Thanks.
 

Users who are viewing this thread

Back
Top Bottom