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 IsNull in the following function:
Public Function TotalUnexcusedIncidents() As Integer
TotalUnexcusedIncidents = DLookup("[TotalUnExcused]", "qryCrosstab30DayIntervalTest1"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
MsgBox "TOTAL UNEXCUSED: " & [TotalUnexcusedIncidents]
End Function
Thanks….. Sam
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 IsNull in the following function:
Public Function TotalUnexcusedIncidents() As Integer
TotalUnexcusedIncidents = DLookup("[TotalUnExcused]", "qryCrosstab30DayIntervalTest1"
MsgBox "TOTAL UNEXCUSED: " & [TotalUnexcusedIncidents]
End Function
Thanks….. Sam