Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing textbox on form to NULL 2

Status
Not open for further replies.

RoyceyBaby

IS-IT--Management
Mar 23, 2001
22
Hi,

I really don't know what I am doing wrong, so I wonder if you guys/girls can help me.

I have a text box on my form called:

text_Currency

I also have a button called:

command_CarriageCharge

I am trying to tell whether text_Currency is blank/null/empty or whatever.

I am using an IF statement to work this out, but i cannot get it to recognise that there is no entry in text_Carriage!


Can anybody give me any hints, i've tried.

If text_Currency = ""
If text_Currency.value = ""
If text_Currency = null
If text_Currency.value = null
If text_Currency = Empty
If text_Currency.value = Empty


Please help, I am finding this quite annoying!

Many thanks,

Royce
 
if nz(len(text_Currency),0)=0 then
'---- its empty
end if



nz function is very handy for access users to use with nulls...

Vince
 
Hi!

If all you need to worry about is nulls, the you can use the IsNull function:

If IsNull(text_Currency) Then

Vince's code above will find nulls and empty strings.

hth
Jeff Bridgham
bridgham@purdue.edu
 
Thanks,

i gave you both a star, because I'm sure I will find a good use for both methods.

Royce
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top