wcoka
asked on
What values should I use to validate an empy field
I open my database this way:
dim b as Database
dim t as recorset
set b=opendatabase(app.path & "\data.mdb")
set b=b.openrecordset("table1" )
t.movefirst
'<<<<Here is my problem>>>
if t.fields("name")="" then msgbox "Empty"
...
When the field "name" is empty it should shows me a msgbox but it doesnt, I already try using instead changing "" to Null but no result.
Why is this happening?
dim b as Database
dim t as recorset
set b=opendatabase(app.path & "\data.mdb")
set b=b.openrecordset("table1"
t.movefirst
'<<<<Here is my problem>>>
if t.fields("name")="" then msgbox "Empty"
...
When the field "name" is empty it should shows me a msgbox but it doesnt, I already try using instead changing "" to Null but no result.
Why is this happening?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
jchopde's suggestion is what I use to work with nulls. Nulls are just a hassle to work with. So you will need to always append a double quote ("") to the variable or field before testing it. Best of luck.
Thanks for the points and Grade
if (t.fields("name") & "") = "" then msgbox "Empty"