If statments

cktcPeterson

Member
Local time
Today, 01:43
Joined
Mar 23, 2022
Messages
74
I have a field [Remaining]

I would like to do a macro where when [Remaining]=0, [Status], "Funds Exhausted"

Or do I do a condional format?
 
depends where you are doing this. if a control on a form or in a query you just do a calculation, no macro required

iif([Remaining]=0, [Status], "Funds Exhausted")

where in a query Remaining and Status are the names of the fields, or in a form or report, then the name of the controls

conditional formatting is about colours and fonts, not content
 
I want this to run as an after update.

So once I add in my amounts, once the remaining is 0, then the status field switches to "Funds Exhausted"
 
you are very vague about the requirement, but if you are running it in an event the code would be something like

if Remaining=0 then somefield= Status else somefield= "Funds Exhausted"

however I have no idea what you really mean - if this is intended to modify the record just entered, then after update is too late, it's already been updated.

think you need to explain very clearly what you are trying to do
 
I would like to do a macro where when [Remaining]=0, [Status], "Funds Exhausted"
you can save some space by Removing Status field.
use query to show the status:

select yourTable.*, IIF([Remaining] < 1, "Funds Exhausted", Null) As Status from yourTable;
 

Users who are viewing this thread

Back
Top Bottom