axys, does Ubik method work if you remove the & " " from the Trim Statement.
Trim should take care of both left and right empty spaces.
I would also check the database as the field returns nothing but somehow a space was entered into the field. Thus causing the problem that you currently have.
postageFee = rs("postage") & ""
If postageFee = "" Then
postageMissing = True
End If
or this
Code:
If rs("postage") & "" = "" Then
postageMissing = True
End If
its just a case of where you do the conversion to a string. if you don't do it then you are comparing some kind of ADO object with an empty string, which will always be false.
i'm not sure that using trim has any effect in this situation either, as you are retrieving a numeric field and not a character string, and therefore there will never be anything to take off either end.
I was using trim to get rid of the extra space I inserted to the string, this was before I saw anyone else use the [rs("postage") & "" = ""] method.
Both methods should have the same result(s) though, as both method instantiate the variable, convert it to a sting and compare it to a null string, making the if statement TRUE if NULL.
asp has an ISNULL(variable) function, but that doesn't always work, depending on the type of variable, and the value of the variable.
Bookmarks