Hi
I am getting a run time error on the dlookup code, because no record meet the criteria, therefore the dlookup returned a null value.
I am getting a run time error on the dlookup code, because no record meet the criteria, therefore the dlookup returned a null value.
Code:
Dim lngLogID As Long
lngLogID = DLookup("[LogID]", "Download_Log", "[JobNumber] = '" & Me.JobNumber & "' and [ClientID]= " & Me.clientid)
Debug.Print lngLogID
If Not IsNull(lngLogID) Then
DoCmd.OpenForm "frmdownloadlog", , , "logid = " & lngLogID, acEdit
Else
DoCmd.OpenForm "frmdownloadlog", , , , acEdit
End If
[code/]
Is there a simple way of handling this?
Thanks for your help