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

checking for nulls

Status
Not open for further replies.

mplbm

Programmer
Feb 9, 2006
24
0
0
GB
If you are reading a field from a database in a loop and then adding the value in the field to a variable, how do you test that the value is not null before adding it?

Thanks,

Mike
 
If you are just trying to avoid the error then add an empty string or a 0 to the field value before using it:

strText = "" & rst.Fields("myString")
intNum = 0 + rst.Fields("myInt")

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top