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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Handling Null Fields 1

Status
Not open for further replies.

porto99

Technical User
Nov 1, 2004
96
GB
I keep getting the error 'Invalid Use of null object' on the following statement:-

<B>strStatement = rst!STATEMENT</B>

How can I check if this field is null?

Many thanks,

 
The quick and dirty way (it looks like this is an asp page or something?) is to do:
strStatement = trim("" & rst!STATEMENT)

Then check strStatement for "". Again--this is the quick & dirty way. Now, I'm well aware of the significant difference between Null and "", and don't want to start that thread here, but in a general sense, doing the above will avoid that error and give you the easy ability to get the code going.

If your db field makes a distinction between Null and "", then that's a new thread.
--Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top