Full Version: Iif statements on a form
UtterAccess Forums > Microsoft® Access > Access Forms
timvanbaars
Hey all,
I'm using an Iif statement to set the value of the "status" field on my form
The status field is based on the "Findings" combo box: if "Yes" is selected in "findings" the
status field should say "Open" and if "No" is selected the status field should say " N/A"
This is what I came up with:
the control source of the "Status" text box:
=IIf([Findings]="Yes","Open","N/A")
This works fine and will display the right data in the text box,
however how do I store the Status value in my database under the Status Field??
Thanks!
Tim
Jack Cowley
Welcome to Utter Access Forums! -o!
The answer is that you don't. Your 'FindingsID' is all that you need.... Also, Findings should be based on a table and the PK is what you want to store, not the text.
If any record in the table has a Finding of Yes then the Status has to be Open...
hth,
Jack
timvanbaars
Thanks for the quick reply!
However please clarify,

A system to audit certain documents:
auditor enters document number,
Selects either "Yes" or "No" under " Finding?" combobox, depending if there is a finding or not
Status should change automatically to "Open" if the auditor selected "Yes"
"N/A" if the user selected "No".
I want to be able to go back to "Close" certain findings, doesnt the Status value have to be stored?
Thanks,
Tim
Jack Cowley
Tim -
indings and Status appear to be the same thing. If a finding is "Yes" then the Status is "Open" so why save Finding AND Status? What I am trying to say is save one OR the other, but not both. Why not just call the control Status and have the person select Open or N/A? As far as I can tell it is all the same....
I hope I am making sense and if not then please let me know... Also, you have given very little information on what forms the auditor has access to and how 'his form' relates to the rest of the database... Is the auditor someone who has limited or specific access to your database?
Jack
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.