Status Field

F

FIECA

Hi All!

I want to create a ("status") field in my contracts tracking table to tell
me the status of the contract based on whether or not some other fields in
the table (yes/no) are checked (yes). Basically, I want to create code
where an inspection of the other fields is made in order. For instance the
fields being

1) received (yes/no)
2) reviewed (yes/no)
3) signed (yes/no)
4) returned (yes/no)
5) executed (yes/no)

the code would inspect each field (preferrably in order) and produce a
result based on what fields have been checked yes or no

again, for instance

1) received yes
2) reviewed yes
3) signed no
4) returned no
5) executed no

would produce a result of "awaiting signature" in the "status" field based
on the first "no" found at 3) signed

any help would be greatly appreciated....


Cheers!!

tom pratt
 
R

Rick B

That is calculated data and should not be stored in the table. If the data
needed to determine the "status" is in the table, then you don't need the
"status" in the table. Instead, create your code/condition in your queries,
forms, and reports to create the status on the fly.
 
F

FIECA

Rick,

Any way you could help me with the code, maybe an example of the structure.
Unfortunately, I am not versed in code, so I wouldn't even know where to
begin. Thanks for the pointer on having the code in forms and queries and
not stored also in the table. Any help with the code would be greatly
appreciated.

Thanks,

Tom
 
R

Rick B

In a query, you'd create a new column and put something like the following
in it...

Status: Status: IIf([Signed],"Signed","Awaiting Signature")


Now, if you have more than one status, and it depends on the various
checkboxes, then you will have to use nested IIF statements, or you will
have to include "and" or "or" conditions.

Status: Status: IIf([Executed],"Contract Executed",IIf([Returned],"Contract
Returned but not executed",IIf([Signed],"Signed","Awaiting Signature")))

Post back if you run into trouble.
 
R

Rick B

Oops. In the nested example, I included "status" twice. It should read:

Status: IIf([Executed],"Contract Executed",IIf([Returned],"Contract Returned
but not executed",IIf([Signed],"Signed","Awaiting Signature")))


--
Rick B



Rick B said:
In a query, you'd create a new column and put something like the following
in it...

Status: Status: IIf([Signed],"Signed","Awaiting Signature")


Now, if you have more than one status, and it depends on the various
checkboxes, then you will have to use nested IIF statements, or you will
have to include "and" or "or" conditions.

Status: Status: IIf([Executed],"Contract
Executed",IIf([Returned],"Contract Returned but not
executed",IIf([Signed],"Signed","Awaiting Signature")))

Post back if you run into trouble.

--
Rick B



FIECA said:
Rick,

Any way you could help me with the code, maybe an example of the
structure. Unfortunately, I am not versed in code, so I wouldn't even
know where to begin. Thanks for the pointer on having the code in forms
and queries and not stored also in the table. Any help with the code
would be greatly appreciated.

Thanks,

Tom
 

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