Recognize Empty fields and report them

capsula4

Registered User.
Local time
Today, 14:33
Joined
Jan 3, 2008
Messages
122
Hi!

I'm not sure if this is a VBA question but I'm guessing it is since I don't know any function (this doesn't say much) that would make what I'm looking for.

Is there a way to recognize all the empty fields per entry? Maybe this would be like a report or a query, but for example, i have this table:

tblMAIN
ID (autonumber) | Field1 | Field2 | Field3 | Field4

I would like sth like a report/qry saying:
ID | Empty Fields
1 | Field1, Field2
2 | Field3, Field4
3 | Field2, Field3, Field4
4 |
5 | Field 3
and so on...
 
Depends on your definition of "empty".
I would a query maybe with the NZ function.
Select F1, F2, F3 from yourtable where NZ([F1],'') = '' OR NZ([F2],0) = 0 etc depending on field type. You could use an IIF and return a Y or N also.
So it might be like.
ID F1 F2 F3 etc.
1 Y N N
2 N Y Y
3 Y N Y
4 N N Y

Just as one way, of course you could use this result in other ways say write a function to return just the columns that are a Y as an example.
 
If I understood good, you are giving me two options...

1. using the NZ function with where condition
2. using If and return Y/N and then creating a module

Or you mean both together? The NZ function would return only those entries in which there are missing fields and the Y/N would say which of em are missing? :confused:
 
What you are calling option 2, would use the first also, but could be stand alone. I just it find it easier to identify the "stuff" with queries first (typically), than you can build on that. The Y and N was just to make it more readable. The NZ is to handle both NULLS and empty fields, hence my statement on what you consider "empty"
 

Users who are viewing this thread

Back
Top Bottom