Concatenating text fields #Error

BayesTex

New member
Local time
Today, 02:52
Joined
Oct 3, 2004
Messages
9
Hi there,

I'm concatenating two or more text fields using the following string:

=[N_Genero] & [Epiteto] & [N_Autor]

However, when I run this report, I get a #Error for the object.
I get this one with other fields too.

I am trying modify it, but nothing happens, like:

with strings: =[N_Genero] & "Hello"
with several ampersands (&): =[N_Genero]&" "&[Epiteto]&" "&[N_Autor]
with parenthesis: =([N_Genero]&" "&[Epiteto]&" "&[N_Autor])
with several strings: =[N_Genero]&" "&[Epiteto]&" "&[N_Autor]


with AND: =[N_Genero] AND [Epiteto] AND [N_Autor]
with AND + parenthesis: =([N_Genero] AND [Epiteto] AND [N_Autor])
With OR: =[N_Genero] OR [Epiteto] OR [N_Autor]
with OR + parenthesis: =([N_Genero] OR [Epiteto] OR [N_Autor])

I get a #1 error, with the last 4 expressions, but I think the correct
way would be like the first 4 expressions.

Everyone are text fields, with similar properties between them.
Some fields may be empty, so that is the reason to
put them inside a one field, to avoid big spaces between words.

What I am doing wrong?

Please, I just need correct this to finnish the report.

Jaime
 
Try:

= Nz([N_Genero], "") & Nz([Epiteto], "") & Nz([N_Autor], "")

Wayne
 
Why not just
= Nz([N_Genero]) & Nz([Epiteto]) & etc? :confused:
 
Make sure that the control Name is not the same as the name of any of the fields in the form's RecordSource.
 
NO solution, Same #Error

Hi friends,

I followed both ways you recommend me to correct my problem, but it does not work, it continue showing #Error.

What is the meaning of Nz command?

Another suggestions or clues?

Thanks in advance,

Jaime :(
 
I got it finally.

Hi, friends,

I can go the correct results finally.

The problem was with strings like " ", I dont know why it doesnt work fine on my system as Wayne write me:

=([N_Genero], "") & Nz([Epiteto], "") & Nz([N_Autor], "")

But when I write the sentence like this:

=Nz([N_Genero]) & Nz(" ") & and so on...

it works fine!

Pat, sorry I dont know if I understand well your question about "Name of the control", but I suppose it is [N_Genero] to this field.

=Nz([N_Genero]) & Nz([Epiteto]) & Nz([N_Autor])

I have another question, How can I apply cursive font to one or more components of the expression, but not to all, I mean, I want this:

Vismia guianensis Diels.

Thanks for your help friends (Wayne, Rich and Pat)!. :)

Jaime
 
Nz([N_Genero])
- when you don't specify a replacement value, Access determines what to use based on the data type. Apparently your fields were numeric. In this case, Access would replace any nulls with zeros. BTW - "" is a zero length STRING. You cannot assign a string to a numeric field.

You can find the name of the control by opening the properties dialog and looking on the Other tab at the Name property. The Name property of this control MUST NOT be the same as any field name from your RecordSource.
 

Users who are viewing this thread

Back
Top Bottom