Strange problem.

R

Rahul Gupta

Hello,
I have a database with few fields including "Name" and "TIN".

I want to create a report such that
=IIf([TIN]<>"",[Name] & char(13) & "Tin: " & [TIN],[Name])

but its not working. Name is displaying name of the report and char (13)
"New Line" is also not working.

Please guide.

Rahul.
 
S

strive4peace

Hi Rahul,

in the NAME property of the control, change it to something else... like
MyName -- or something more descriptive. then use the name you have
created in your equation instead of [Name]

Problem names and reserved words in Access, Allen Browne
http://www.allenbrowne.com/AppIssueBadWord.html

~~~~~~~~~~~

instead of char(13), try chr(13) & chr(10)

~~~~~~~~~~~

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
V

Van T. Dinh

Try:

=IIf( [TIN]<>"",
Report![Name] & Chr(13) & Chr(10) & "Tin: " & [TIN],
Report![Name] )

(I break into multiple lines for clarity but you should use all on one
line).

You should not use "Name" as a Field name in your Tables. Every object in
Access has the Property "Name".
 
J

John Vinson

Hello,
I have a database with few fields including "Name" and "TIN".

I want to create a report such that
=IIf([TIN]<>"",[Name] & char(13) & "Tin: " & [TIN],[Name])

but its not working. Name is displaying name of the report and char (13)
"New Line" is also not working.

Please guide.

Rahul.

Name is a reserved word. Reports have a Name property; tables have a
Name property; almost anything in an Access database has a Name
property. I'd very strongly suggest changing the Name of the Name
field to some other Name that isn't a reserved Name.

A new line requires TWO characters: Chr(13) & Chr(10) in that order
(carriage return and line feed). (Note Chr() not Char()).

John W. Vinson[MVP]
 
V

Van T. Dinh

Check on your Report to see if you have any (TextBox) Control named "Name"
....

You might like to try:

Report.Fields("Name")

That's why we avoid using "Name" as a Field name: it is very confusing as
virtually every object in Access has the Property "Name".

--
HTH
Van T. Dinh
MVP (Access)



Rahul Gupta said:
Hello Van,

thanks for the ans. Your ans answered my query partially. Report![Name]
did
not work for me.

Thanks for the rest,
Rahul.

Van T. Dinh said:
Try:

=IIf( [TIN]<>"",
Report![Name] & Chr(13) & Chr(10) & "Tin: " & [TIN],
Report![Name] )

(I break into multiple lines for clarity but you should use all on one
line).

You should not use "Name" as a Field name in your Tables. Every object
in
Access has the Property "Name".

--
HTH
Van T. Dinh
MVP (Access)



Rahul Gupta said:
Hello,
I have a database with few fields including "Name" and "TIN".

I want to create a report such that
=IIf([TIN]<>"",[Name] & char(13) & "Tin: " & [TIN],[Name])

but its not working. Name is displaying name of the report and char
(13)
"New Line" is also not working.

Please guide.

Rahul.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top