This query in the builder returns one row as expected
SELECT Log.ID, Log.Nature
FROM Log
WHERE (((Log.ID)="123") AND ((Log.Nature) Like "*Visit*"));
But this in vba returns rows where Log.Nature does not include the string 'Visit'
strSQL= "SELECT Log.ID, Log.Nature" & _
" FROM Log WHERE (((Log.ID)='" & ID & "')" & _
" AND ((Log.Nature) Like '*Visit*'))"
In fact it seems to return all rows where the ID matches. Can someone tell me what I'm doing wrong?
SELECT Log.ID, Log.Nature
FROM Log
WHERE (((Log.ID)="123") AND ((Log.Nature) Like "*Visit*"));
But this in vba returns rows where Log.Nature does not include the string 'Visit'
strSQL= "SELECT Log.ID, Log.Nature" & _
" FROM Log WHERE (((Log.ID)='" & ID & "')" & _
" AND ((Log.Nature) Like '*Visit*'))"
In fact it seems to return all rows where the ID matches. Can someone tell me what I'm doing wrong?