Link to home
Start Free TrialLog in
Avatar of wcoka
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?
ASKER CERTIFIED SOLUTION
Avatar of GoodJun
GoodJun

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jchopde
jchopde

or this --

if (t.fields("name") & "") = "" then msgbox "Empty"
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