Never mind... I have already solved this one. My modified code:
Code:
If IsNull(DLookup("IP", "IPAddress", "[IPAddress].IP = '" & NewIP & "'")) Then
''' Insert the new IP Address
DoCmd.RunSQL "INSERT INTO IPAddress (IP, IPType, FriendlyName, Ports) VALUES" & _
"('" & NewIP & "', '" & NewIPType & "', '" & NewFNm & "', '" & NewPort & "')"
''' Close the frmNewIPAdr and return to frmIPAddresses
DoCmd.Close acForm, "frmNewIPAdr", acSaveNo
Else
''' The IP Address already exists display a message and exit the form
myMsg = MsgBox("The IP Address already exists. Enter a better IP!", vbInformation, "IP Already Exists")
DoCmd.CancelEvent
Me.txtNewIPAdr.SetFocus
Exit Sub
End If
Works perfectly.