Retrieve Column Name

Drunkenneo

Registered User.
Local time
Tomorrow, 02:41
Joined
Jun 4, 2013
Messages
192
abc def reason
1
2

I have table in which i want to update reason column as "def missing" on 1st record and "abc missing" on second record.

Please help, Thanks in advance.
 
and I want a Hula Hoop for Christmas. :rolleyes:

You need to explain is that exactly you are trying to do.. With means of proper data, explaining what you have done so far.. With description like that, I am not sure if anyone would be able to give the right answer.
 
i have a excel file need to imported, which has nearly 110 Columns, after importing there are required columns which should not be empty, so access will be taking them out from database in form of Excel where it needs "reason for Rejection", stating so and so column data is missing.

Reason is there are total 12 columns need to be check for such instances of null and the records are nearly more than 200, in single query i could fetch the column name updating the reason as this column is missing, then it would be nice.
 
Basically you need to test if a field is empty. It should check for the possibility of zero length string, strings composed entirely of spaces or an actual Null.

Trim() is used to remove spaces at the beginning and end of a string. ZLS can be checked for length. Nz converts the Null to a ZLS.

So the test could be:
Code:
Len(Trim(Nz[fieldname],""))=0
This expression could be turned into a function that returns True for a value being missing to simplify its repeated use.

With a small number of fields an IIF would be practical in an update query. Two fields can be done like this but the concept can be extended:
Code:
IIF(MyFunction([field1]),"Field1 missing",IIF(MyFunction([field2]), "Field2 missing",Null))

With twelve fields this is going to be a hell of an expression. Moreover, can two fields be missing on the same record? What would be the entry then?

It would be better to pass all the field values to a single function where the logic can be managed more clearly.
 

Users who are viewing this thread

Back
Top Bottom