concatenate name fields for display (1 Viewer)

jmlight

Registered User.
Local time
Today, 00:52
Joined
Feb 6, 2009
Messages
54
In my form, I have FirstName and LastName fields displayed. I would like to trim the spaces and have the two fields concatenate for display purposes.

I have tried going to the field Properties in Design View, and then attempted to make an expression something like:
firstname & " " & Lastname

All that shows up where the field should be is the word Error.

I'm sure there's a way to do this that trims the leading and trailing spaces and makes the name look like I typed them together.

Help?
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 21:52
Joined
Aug 30, 2003
Messages
36,140
As a textbox control source, try:

=Trim(firstname) & " " & Trim(Lastname)

Make sure no textbox or other control has either of those names.
 

jmlight

Registered User.
Local time
Today, 00:52
Joined
Feb 6, 2009
Messages
54
Thanks Paul - that worked. I just had to make a "new" unbound text box instead of trying to make an expression out of an existing field.

At least I've got ONE thing right so far!
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 21:52
Joined
Aug 30, 2003
Messages
36,140
Yeah, the wizard will name the control the same as the field, and when you try to make an expression like that it gets confused. You could also have renamed the control.
 

Users who are viewing this thread

Top Bottom