Please everyone read post #10 and stop trying to fix this portion of the issue:
https://www.access-programmers.co.uk/forums/showpost.php?p=1558788&postcount=10
The total logic is just too complex to fit into one expression, you need a custom function. When you do that, in a query it will look like this:
ActionNeeded: get_ActionNeeded([next_appointment_date], [anticipated_completion_date], ...{all values needed to determine Action Needed}...)
Then in a module, you will have code that implements your logic like so:
https://www.access-programmers.co.uk/forums/showpost.php?p=1558788&postcount=10
The total logic is just too complex to fit into one expression, you need a custom function. When you do that, in a query it will look like this:
ActionNeeded: get_ActionNeeded([next_appointment_date], [anticipated_completion_date], ...{all values needed to determine Action Needed}...)
Then in a module, you will have code that implements your logic like so:
Code:
Public Function get_ActionNeeded(NextAppointment, AnticipatedCompletion, ....{all values needed to determine Action Needed}...)
' takes set of data and determines the action neeeded
ret = "Error"
' return value, error by default
If (NextAppointment Is Not Null) And (AnticipatedCompletion Is Not Null) Then ret ="Consult medical director "
If (NextAppointment < (Date() + 2) AND (NextAppointment Is Not Null) Then ret ="Request Anticipated ",
...
...
more logic expressions
...
...
get_ActionNeeded = ret
' returns correct value
End Function