473,395 Members | 1,521 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Handling Nulls in a String

83
I have a button that when pressed on a form, automatically reads statments and inputs a text sentence, based on other fields on the form. However, the variable only gets assigned a sentence if something is true, but null if it is not true. The below code sits after all of the criteria statements. The problem is that when the first four statements are null, the field has four spaces before the sentence. This is obvious because of the " " after ever variable. Is there an automatic function that only read a space if the previous variable is not null, or do I have to make an isnull statement for every " ".

[code]Me.Pending_Reasons = NoLE & " " & updttfs & " " & updtavs & " " & Illno & " " & updtfas & " " & updtmidl & " " & updtisc & " " & SurNoLE & " " & surupdtfs & " " & surupdtmidl & " " & surupdtemsi & " " & surupdtavs & " " & surupdtfas & " " & surupdtisc[code/]
May 15 '07 #1
2 1609
nico5038
3,080 Expert 2GB
I've moved your question to the Access forum, thus it's visible by more experts.

For conditional filling you can use an IF statement, but also the "+" character instead of the "&".
When a Null value is attached to the string with a "+", then the whole string will be "nullified".

Thus you can use:
varible = "Name " & "middlename" + " " & ....

Nic;o)
May 15 '07 #2
NeoPa
32,556 Expert Mod 16PB
Nice one Nico - Thanks. I never knew that :)
May 15 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: spshealy | last post by:
Greetings, I have a question about how nulls are handled in "IN" clauses.. I understand the operation null = anyvalue is undefined. Please examine the following example. drop table one...
1
by: PST | last post by:
Here's a problem I'm trying to deal with: I'm working on a Frontpage 2000 website for a boat handicapping system, built in Access 97. What I'm trying to accomplish is: The user enters a...
13
by: jt | last post by:
I can't seem to find a way to concatenate strings that have nulls within the string. I have a string that I need another string that has nulls in it and what to append the 2nd string, 3 string...
4
by: Vagabond Software | last post by:
Apparently, the Split method handles consecutive tabs as a single delimiter. Does anyone have any suggestions for handling consecutive tabs? I am reading in text files that contain lines of...
1
by: buc | last post by:
I have created a byte array (1000 in size) to recv a network packet. I recv the packet, which varies in size, and need to put the packet in a string; so I can append another string after the packet...
5
by: AAJ | last post by:
Hi Does anyone know of any good publically available set of standards for managing dates when dealing with a database server (in my case SQL Server 2000 and c# VS2005). At the moment, if I...
2
by: CharlesL | last post by:
I am trying to handle binary strings in php. I get a binary output initialization vector from mcrypt as such: from mcrypt: $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); This output may have...
3
by: =?Utf-8?B?ai5hLiBoYXJyaW1hbg==?= | last post by:
Hello, I've eliminated the bulk of code, this should be sufficient: byte fromEncrypt; string sDecryptedString; //Read the data out of the crypto stream. csDecrypt.Read(fromEncrypt, 0,...
41
by: Zytan | last post by:
Ok something simple like int.Parse(string) can throw these exceptions: ArgumentNullException, FormatException, OverflowException I don't want my program to just crash on an exception, so I must...
2
by: =?Utf-8?B?QWJoaW1hbnl1IFNpcm9oaQ==?= | last post by:
Hi, I am using Visual C++ in Visual Studio 2005 to create a Managed Wrapper around some C++ LIBS. I've created some classes that contains a pointer to the LIB classes and everthing seems to...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.