Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Null value return from combo box

My userform has a combo box. When I refer to "userform.cbx1.value", I
sometimes get "Null". It's inconsistent, because sometimes I get the value
selected from the list. It's just a basic (2-columned) combo box. Any
ideas why I get "Null"?

TIA


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Null value return from combo box

One main reason why you may get null, there is nothing at all in the cell.
There's a difference between a Null (which means undefined) and an empty
string, which is define as a string with nothing in it, but still returns
the empty string (""). One example of why you may want this distinction
would be dealing with appartment numbers.

Say one of your customers lives in an apartment complex, however, the
apartment number for whatever wasn't captured. Do you put in the textbox as
an empty string or do you leave it as undefined. In this case, it would be
left as undefined cause that piece of information isn't known.

Now, another customer owns and lives in a house, and there is no one else
that lives in the home other than those that lives with that same person as
one household unit. In that cause, you know that customer doesn't have an
apartment unit within the house, so the value of the textbox in that case
would be the empty string to indicate there is no apartment number.

Now, how can you test for this null value if the value is null?

Answer, use the IsNull Function as the condition of an
If...Then[...ElseIf][...Else]...End If statement.

Hope this has helped in clearing up your issue.

--
Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
"zsplash" wrote in message
...
My userform has a combo box. When I refer to "userform.cbx1.value", I
sometimes get "Null". It's inconsistent, because sometimes I get the

value
selected from the list. It's just a basic (2-columned) combo box. Any
ideas why I get "Null"?

TIA




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Null value return from combo box

Thank you, Ron. That explanation helps. I think the problem has to do with
my using Row Source (to indicate what the combo box is "populated with"),
but, then, the combo box doesn't always "get" the list, so turns up null,
even though the user has input something. If the current active worksheet
is something other than where the Row Source list is located, the combo box
has no list-values, and since Match is required, "input" doesn't "match"
anything in the Row Source address. (I guess.....)

st.

"Ronald Dodge" wrote in message
...
One main reason why you may get null, there is nothing at all in the cell.
There's a difference between a Null (which means undefined) and an empty
string, which is define as a string with nothing in it, but still returns
the empty string (""). One example of why you may want this distinction
would be dealing with appartment numbers.

Say one of your customers lives in an apartment complex, however, the
apartment number for whatever wasn't captured. Do you put in the textbox

as
an empty string or do you leave it as undefined. In this case, it would

be
left as undefined cause that piece of information isn't known.

Now, another customer owns and lives in a house, and there is no one else
that lives in the home other than those that lives with that same person

as
one household unit. In that cause, you know that customer doesn't have an
apartment unit within the house, so the value of the textbox in that case
would be the empty string to indicate there is no apartment number.

Now, how can you test for this null value if the value is null?

Answer, use the IsNull Function as the condition of an
If...Then[...ElseIf][...Else]...End If statement.

Hope this has helped in clearing up your issue.

--
Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
"zsplash" wrote in message
...
My userform has a combo box. When I refer to "userform.cbx1.value", I
sometimes get "Null". It's inconsistent, because sometimes I get the

value
selected from the list. It's just a basic (2-columned) combo box. Any
ideas why I get "Null"?

TIA






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Return null Karen Excel Worksheet Functions 3 June 11th 08 08:43 AM
Compare Value in Cell 1 to a List, Return Value if Match otherwise Return Null Ben Excel Discussion (Misc queries) 2 March 15th 07 01:02 AM
Have DGET return Null instead of #Value! matthoffman33 Excel Worksheet Functions 3 May 6th 06 02:21 AM
Cell to return null instead of 0 dford Excel Discussion (Misc queries) 7 November 28th 05 06:37 PM
return a " " for null values David# Excel Worksheet Functions 2 January 21st 05 06:47 PM


All times are GMT +1. The time now is 01:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"