I have the following SQL statement and when I step thru in the debugger it shows a value for InterventionTimeId (which is numeric) but then gives me the error "Invalid use of Null." when it tries to write to lngKey.
My objective is to replace my "findfirst" statement with this. I thought if lngKey returned a value then I would have it go thru my edit code and if it didn't then I'd have it add. But I get the same result either way.
Suggestions on the correct way to so this would be greatly appreciated.
Dim lngKey As Long
lngKey = DLookup("InterventionTimeId", "dbo_tblInterventionTime", [InterventionTimeID] = " & txtInterventionTimeID & ")