Could prevent the error by using a combobox that only offers valid PO numbers to select and set the combobox LimitToList property to Yes.
Otherwise, use DLookup() or DCount() domain aggregate function:
If DCount("*", "MXDPO", "[PO Number]='" & Me.txtKeywords & "'") > 0 Then
MsgBox "No records found! Check again!"
Else
...
End If
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Could prevent the error by using a combobox that only offers valid PO numbers to select and set the combobox LimitToList property to Yes.
Otherwise, use DLookup() or DCount() domain aggregate function:
If DCount("*", "MXDPO", "[PO Number]='" & Me.txtKeywords & "'") > 0 Then
MsgBox "No records found! Check again!"
Else
...
End If
Hi, can this code work if my search input is a string? such as ABC17/123?
cross posted and solution found here
https://www.access-programmers.co.uk...=1#post1550245
The example given is for a string value.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.