Condition in macro to check empty\null fields in a table in Access

G

Guest

hi, i want to check a field in the table is empty\null. i used a conditon
[Reports]![repCSMCFax]![Agency]<>" " but it returns an error when executed
"Type Mismatch"
but the same condtion works on Access 2.0 and not on Access 2003.

So pls if any of you guys out there have any solution out of it pls do share
in.

Thanking you.
 
A

Arvin Meyer

" " is not an empty string. "" is an empty string. you can also try:

IsNull([Reports]![repCSMCFax]![Agency] OR
IsEmpty([Reports]![repCSMCFax]![Agency])

or what I use in VBA code (but not in a macro)

Len([Reports]![repCSMCFax]![Agency] & vbNullString) = 0
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top