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

null field value and field names vs. variables

Status
Not open for further replies.

DebbieDavis

Programmer
Jun 7, 2002
146
US
Hello all. I didn't know how to search for this so please forgive me if it's redundant. I'm pulling information from an orders table into a form for review. If some of the fields are empty, I receive the ugly error '80020009' . This particular one errored on a field called rs("ship_to_name") which is null. There are so many fields, do I have to assign variables for them then do an if statement like this:
Code:
if rs("ship_to_name")>"" then
ship_to_name=rs("ship_to_name")
else
ship_to_name=""
end if
or is there another way to avoid the error. I would prefer not to use on error resume next. Thoughts greatly appreciated!
thanks in advance.
 
Try this:

if isnull(rs("ship_to_name")) then
ship_to_name=rs("ship_to_name")
else
ship_to_name=""
end if


-VJ
 
sorry...

what i meant is ---No need to assign variables...

just use the condition

isnull(rs("ship_to_name")) to check the records that have ship_to_name empty

-VJ

 
Thanks. I was trying to avoid all of that. Isn't that basically what I had above? It seems like it's too much to write because I have 30 fields but I guess I'll have to do it anyway. Many thanks again for your response!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top