Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 17th, 2003, 02:53 PM
Authorized User
 
Join Date: Nov 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default text string expressions on a report

I have the following expression in a text box on a report (for contacts). Not all contacts have a middle name, suffix or title.

=[title]+" "+[first_name]+" "+[middle_name]+" "+[last_name]+" "+[suffix]

Some of those contacts' names do not show on the report while some do.

i.e. Mr. Joe Smith (no middle name or suffix) shows fine on the report. On another, Mr. Joe Schmoe, it will not show a name at all. If I change the expression to just include the Title, first and last names, it appears just fine. However, then the entire report omits the middle name and suffix for every contact.

Can anyone tell me why this is happening? And possibly how to correct or work around it?

Thanks,
Nick
 
Old December 17th, 2003, 04:02 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You are dealing with null values and Access can't (or just won't) append nulls in an expression. Therefore, you have to use the NZ function. Look it up in online help.

Regards,

Beth M
 
Old December 17th, 2003, 05:10 PM
Authorized User
 
Join Date: Nov 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'll give it a shot.

Thanks!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Splitting a text string ghall202 Access 4 February 14th, 2008 05:45 PM
Regular expressions and string matching DennyLoi Java Basics 0 November 15th, 2007 01:37 PM
Text String to XML testsubject Visual Studio 2005 1 November 27th, 2006 06:26 AM
Text String to XML testsubject XML 1 November 26th, 2006 06:50 PM
Parsing a text string medix_911 Access 8 November 21st, 2006 01:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.