I have this part of code which could not work it gave message record not found, even value exist.
I am not sure what is wrong with like condition?
Is the problem Left outer join? I tried with Inner Join it is the same.
Dim rst As DAO.Recordset
Dim strBusName As String
Set db = CurrentDb
Dim strSQL As String
If (Not IsNull(Me.txtBusinessName)) And Me.txtBusinessName.Value <> "" Then
strBusName = Nz(Me.txtBusinessName, "")
'strSQL = "Select * from tblContact WHERE LastName Like '" & strL_Name & "*'"
strSQL = "Select * From tblContact Left Outer JOIN tblBusiness ON tblContact.ContactID = tblBusiness.ContactID WHERE tblBusiness.BusinessName Like '" & strBusName & " *'"
Set rst = db.OpenRecordset(strSQL, dbOpenDynaset)
If rst.BOF = True And rst.EOF = True Then ' no record found
MsgBox "No record found"
Set rst = Nothing