@plog
I get run time error 424. object required. and I can't get the error to go away.
I'm calling the function form a query that is a row source for a form.
What am I doing wrong? thanks
I get run time error 424. object required. and I can't get the error to go away.
Option Compare Database
Public Function get_ActionNeeded(NextAppointmentDate, AnticipatedCompletionDate, ExtractionTime, TimeToReciept, TimeToRequest)
' takes set of data and determines the action neeeded
ret = "Error"
' return value, error by default
If (NextAppointmentDate Is Not Null And AnticipatedCompletionDate Is Not Null And AnticipatedCompletionDate > NextAppointmentDate) Then
ret = "Consult medical director"
End If
If (NextAppointmentDate < (Date + 2) And (NextAppointmentDate Is Not Null) And (AnticipatedCompletionDate Is Null)) Then
ret = "Request Anticipated"
End If
If (ExtractionTime > 3 And (ExtractionTime Is Not Null)) Then
ret = "Consult technologist"
End If
If ((TimeToReciept > 3) And (TimeToReciept Is Not Null)) Then
ret = "Call 66800"
End If
If ((TimeToRequest > 1) And (TimeToRequest Is Not Null)) Then
ret = "Remind pathologist"
End If
get_ActionNeeded = ret
' returns correct value
End Function
I'm calling the function form a query that is a row source for a form.
Code:
ActionNeeded: get_ActionNeeded([next_appointment_date], [anticipated_completion_date], [ExtractionTime], [TimeToReciept], [TimeToRequest])
What am I doing wrong? thanks