I have the following function (see below) that runs a cross tab query which produces 1 record. However, sometimes, the query has no records to produce. At that time I get run-time Error. I tried to use the IsNull function, to solve this problem, but I guess I am using it wrong. Would anyone tell me the correct format of using it in the following function:
Public Function TotalUnexcusedIncidents() As Integer
TotalUnexcusedIncidents = DLookup("[TotalUnExcused]", "qryCrosstab30DayIntervalTest1"
MsgBox "TOTAL UNEXCUSED: " & [TotalUnexcusedIncidents]
End Function
Thanks….. Sam
Public Function TotalUnexcusedIncidents() As Integer
TotalUnexcusedIncidents = DLookup("[TotalUnExcused]", "qryCrosstab30DayIntervalTest1"
MsgBox "TOTAL UNEXCUSED: " & [TotalUnexcusedIncidents]
End Function
Thanks….. Sam