if the results are not found. How can I set it up so that it does not give me "invalid use of null" error?
My code looks like this:
If Not IsNull(cbAddress) And cbAddress <> "N/A" Then
Dim strState As String
Dim strCity As String
Dim strZip As String
strCity = DLookup If Not IsNull(cbAddress) And cbAddress <> "N/A" Then
Dim strState As String
Dim strCity As String
Dim strZip As String
strCity = DLookup("City", "DefendantAddress", "DefendantID ='" & txtDefendantID & "'" & _
" AND Address = '" & cbAddress & "'")
strState = DLookup("City", "DefendantAddress", "DefendantID ='" & txtDefendantID & "'" & _
" AND Address = '" & cbAddress & "'")
strZip = DLookup("City", "DefendantAddress", "DefendantID ='" & txtDefendantID & "'" & _
" AND Address = '" & cbAddress & "'")
Me.txtAddress = strCity & ", " & strState & " " & strZip
End If
My code looks like this:
If Not IsNull(cbAddress) And cbAddress <> "N/A" Then
Dim strState As String
Dim strCity As String
Dim strZip As String
strCity = DLookup If Not IsNull(cbAddress) And cbAddress <> "N/A" Then
Dim strState As String
Dim strCity As String
Dim strZip As String
strCity = DLookup("City", "DefendantAddress", "DefendantID ='" & txtDefendantID & "'" & _
" AND Address = '" & cbAddress & "'")
strState = DLookup("City", "DefendantAddress", "DefendantID ='" & txtDefendantID & "'" & _
" AND Address = '" & cbAddress & "'")
strZip = DLookup("City", "DefendantAddress", "DefendantID ='" & txtDefendantID & "'" & _
" AND Address = '" & cbAddress & "'")
Me.txtAddress = strCity & ", " & strState & " " & strZip
End If