concatenating fields

  • Thread starter Thread starter David Popham
  • Start date Start date
D

David Popham

Hello all,

This is an incredably naive question, but even after
following the examples in the texts, I still end up with
an error.

I have a table, named Donor, with the following fields
among others:

Sal FirstName LastName
Mr. John Smith
Mrs. Alice Cooper

I have a report with a text box in which I would like to
have the outout formatted as

Mr. John Smith
Mrs. Alice Cooper

etc.

I have tried entering the following expression in the
Control Source using the Expression Builder

=[Donors]![Sal]&" "&[Donors]![FirstName]&" "&[Donors]!
[LastName]

What happens is that when I open the report it prompts an
inputbox with the following title Enter Parameter Value

Whether I ignore it or not my report ends up with the
error expression #Error.

I am very new to using MS Access, but I have add more than
some experience in Excel and VBA so I thought I should be
able to solve this puppy. I can't so I hope one of you can
help me please.

David
 
David,
Regarding:
What happens is that when I open the report it prompts an
inputbox with the following title Enter Parameter Value

Enter Parameter Value WHAT???
Sal, FirstName, LastName ?

Always start with an unbound control when you use an expression.
It will save you lot's of these #error problems.

1) Set the control source to:
= [Sal] &" "& [FirstName] & " " & [LastName]

2) Make sure the name of the control is not 'Sal' nor 'FirstName' nor
'LastName'.

The name of a control cannot be the same as the name of a field
used in it's control source expression.

Using an unbound control will resolve this situation,
as unbound controls are named text1, text2, etc., .

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


David Popham said:
Hello all,

This is an incredably naive question, but even after
following the examples in the texts, I still end up with
an error.

I have a table, named Donor, with the following fields
among others:

Sal FirstName LastName
Mr. John Smith
Mrs. Alice Cooper

I have a report with a text box in which I would like to
have the outout formatted as

Mr. John Smith
Mrs. Alice Cooper

etc.

I have tried entering the following expression in the
Control Source using the Expression Builder

=[Donors]![Sal]&" "&[Donors]![FirstName]&" "&[Donors]!
[LastName]

What happens is that when I open the report it prompts an
inputbox with the following title Enter Parameter Value

Whether I ignore it or not my report ends up with the
error expression #Error.

I am very new to using MS Access, but I have add more than
some experience in Excel and VBA so I thought I should be
able to solve this puppy. I can't so I hope one of you can
help me please.

David
 
Back
Top