Combining forename and surname fields in report

  • Thread starter SamMexico via AccessMonster.com
  • Start date
S

SamMexico via AccessMonster.com

Hi All, I've been searching for about an hour to resolve a little problem
with my reports and need some help...

My report has a forename field and surname field that come directly from the
table, the problem is that there is a gap between the two fields and not all
of the data is showing up in the report.

Is it possible to combine the two fields so that the full name displays
smoothly? The surname is in upper case but if this changes it doesn't really
matter...

Please help!

Sam
 
D

Daryl S

Sam -

On your report use a field with values like this:

=[forename] & " " & [surname]

(but use your field names)
 
S

SamMexico via AccessMonster.com

So I could delete the surname field in the report and add that code to the
forename field? Do the values you mention go in the properties of the surname
field in that case?

Thanks for responding - that's twice you've helped me out!

Sam
 
J

John Spencer

ONLY if you rename the control. IF the control has the same name as a field,
you will get an error message.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
S

SamMexico via AccessMonster.com

Thanks John, I presume I'll find the control in the field properties...?
 
J

John Spencer

Reports have controls.
Controls have Control Source properties. A control source can be a reference
to a field or it can be an expression. Control's have a name property.

In a control, you can use the following as the source
=[FirstNameField] * " " & [LastNameField]

If the control's name property is FirstNameField, then Access will generate an
error as it won't "know" if you are attempting to refer to the field
FirstNameField in the table or to the control with the same name.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
S

SamMexico via AccessMonster.com

Daryl and John, thanks for your help - it works perfectly now!

Sam
 

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