Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default null text box

hi,
I am having a little problem with a text box on a form.
I don't seem to know the correct syntax.
the text box may or may not have something in it.
the code runs, does a lot of things but if the text box is
empty then the code is suppose to skip over part of the
code. if the text box has a number in it, then the code
should run the code associated with the text box.
in access the syntax would be:
if not (isnull(me.textbox) then
run this code and loop until lt.value = text box.value
end if
with this if statement, if the text box is empty then the
code would be skipped. if there is a number in the text
box, the code would run.
but in excel that don't seem to work. the code associated
with the text box runs whether the text box is empty or
not. this is causing a overflow problem due to endless run
away calculations leading to crash and burn.
Does anyone know what the correct syntax would be.

thanks in advance.
FSt1

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default null text box

A textbox doesn't return null

if len(trim(textbox1.Text)) = 0 then
' textbox is empty

or

if Textbox1.Text = "" then

but the second would consider a textbox with just spaces as not empty (which
may or may not be your intent).



--
Regards,
Tom Ogilvy


"FSt1" wrote in message
...
hi,
I am having a little problem with a text box on a form.
I don't seem to know the correct syntax.
the text box may or may not have something in it.
the code runs, does a lot of things but if the text box is
empty then the code is suppose to skip over part of the
code. if the text box has a number in it, then the code
should run the code associated with the text box.
in access the syntax would be:
if not (isnull(me.textbox) then
run this code and loop until lt.value = text box.value
end if
with this if statement, if the text box is empty then the
code would be skipped. if there is a number in the text
box, the code would run.
but in excel that don't seem to work. the code associated
with the text box runs whether the text box is empty or
not. this is causing a overflow problem due to endless run
away calculations leading to crash and burn.
Does anyone know what the correct syntax would be.

thanks in advance.
FSt1



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default null text box

Hi FSt1

You are missing a )

if not (isnull(me.textbox) then
run this code and loop until lt.value = text box.value
end if

if not (isnull(me.textbox)) then
run this code and loop until lt.value = text box.value
end if

Thanks,

Greg

-----Original Message-----
hi,
I am having a little problem with a text box on a form.
I don't seem to know the correct syntax.
the text box may or may not have something in it.
the code runs, does a lot of things but if the text box

is
empty then the code is suppose to skip over part of the
code. if the text box has a number in it, then the code
should run the code associated with the text box.
in access the syntax would be:
if not (isnull(me.textbox) then
run this code and loop until lt.value = text box.value
end if
with this if statement, if the text box is empty then the
code would be skipped. if there is a number in the text
box, the code would run.
but in excel that don't seem to work. the code associated
with the text box runs whether the text box is empty or
not. this is causing a overflow problem due to endless

run
away calculations leading to crash and burn.
Does anyone know what the correct syntax would be.

thanks in advance.
FSt1

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default null text box

Thanks Tom.
-----Original Message-----
A textbox doesn't return null

if len(trim(textbox1.Text)) = 0 then
' textbox is empty

or

if Textbox1.Text = "" then

but the second would consider a textbox with just spaces

as not empty (which
may or may not be your intent).



--
Regards,
Tom Ogilvy


"FSt1" wrote in

message
...
hi,
I am having a little problem with a text box on a form.
I don't seem to know the correct syntax.
the text box may or may not have something in it.
the code runs, does a lot of things but if the text box

is
empty then the code is suppose to skip over part of the
code. if the text box has a number in it, then the code
should run the code associated with the text box.
in access the syntax would be:
if not (isnull(me.textbox) then
run this code and loop until lt.value = text

box.value
end if
with this if statement, if the text box is empty then

the
code would be skipped. if there is a number in the text
box, the code would run.
but in excel that don't seem to work. the code

associated
with the text box runs whether the text box is empty or
not. this is causing a overflow problem due to endless

run
away calculations leading to crash and burn.
Does anyone know what the correct syntax would be.

thanks in advance.
FSt1



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default null text box

Thanks
-----Original Message-----
Hi FSt1

You are missing a )

if not (isnull(me.textbox) then
run this code and loop until lt.value = text box.value
end if

if not (isnull(me.textbox)) then
run this code and loop until lt.value = text box.value
end if

Thanks,

Greg

-----Original Message-----
hi,
I am having a little problem with a text box on a form.
I don't seem to know the correct syntax.
the text box may or may not have something in it.
the code runs, does a lot of things but if the text box

is
empty then the code is suppose to skip over part of the
code. if the text box has a number in it, then the code
should run the code associated with the text box.
in access the syntax would be:
if not (isnull(me.textbox) then
run this code and loop until lt.value = text

box.value
end if
with this if statement, if the text box is empty then

the
code would be skipped. if there is a number in the text
box, the code would run.
but in excel that don't seem to work. the code

associated
with the text box runs whether the text box is empty or
not. this is causing a overflow problem due to endless

run
away calculations leading to crash and burn.
Does anyone know what the correct syntax would be.

thanks in advance.
FSt1

.

.

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
Hyperion Essbase Excel Add-in - returning text ("0") for null valu bill_morgan Excel Discussion (Misc queries) 7 February 28th 12 05:10 AM
Failed to save table attributes of (null) into (null). Luca Brasi Excel Discussion (Misc queries) 2 February 4th 09 04:30 PM
Not plotting null or text data Vince F Charts and Charting in Excel 2 June 27th 08 05:20 PM
If statement that outputs specific text if cell is not null mcmilja Excel Discussion (Misc queries) 2 June 4th 08 02:26 PM
COUNTIF says Null = Blank but Blank < Null Epinn Excel Worksheet Functions 4 October 25th 06 08:03 PM


All times are GMT +1. The time now is 03:52 PM.

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

About Us

"It's about Microsoft Excel"