I am trying to run a Find on a ADO recordset using
an SQL syntax for the Find.
I need to run for a WildCard Character.
here is my code.
----------------------------------------------------------------
Dim adoQuoteRS As Recordset
'create a recordset to search on
Dim strsql As String
Set adoQuoteRS = New Recordset
strsql = "SELECT tblQuotes.*, tblQuoteLog.*, tblProjects.* " & _
"FROM tblProjects " & _
"INNER JOIN tblQuotes ON tblProjects.ProjectsID = tblQuotes.ProjectID " & _
"INNER JOIN tblQuoteLog ON tblQuotes.QuoteID = tblQuoteLog.QuoteID"
adoQuoteRS.Open strsql, g_objConn, adOpenStatic
If FindLookIn = "QuotationNo" Then
'If FindLookIn = "Entire Database" Then
With adoQuoteRS
.MoveFirst
'.Find (FindLookIn & "= '" & findvalue & "'"
.Find ("QuotationNo = '%10881'"
'WHERE (QuotationNo LIKE '%10881')
If .BOF Then
MsgBox "Matching Record not Found"
End If
End With
End If
adoQuoteRS.Close
---------------------------------------------------------------
I cannot get VB to accept the LIKE as valid If I just look for the
entire value then I can find it with out using a wildcard character.
any help would be appreciated.
Also when I open my recordset in dynamic mode I get a recordcount of -1 ????
an SQL syntax for the Find.
I need to run for a WildCard Character.
here is my code.
----------------------------------------------------------------
Dim adoQuoteRS As Recordset
'create a recordset to search on
Dim strsql As String
Set adoQuoteRS = New Recordset
strsql = "SELECT tblQuotes.*, tblQuoteLog.*, tblProjects.* " & _
"FROM tblProjects " & _
"INNER JOIN tblQuotes ON tblProjects.ProjectsID = tblQuotes.ProjectID " & _
"INNER JOIN tblQuoteLog ON tblQuotes.QuoteID = tblQuoteLog.QuoteID"
adoQuoteRS.Open strsql, g_objConn, adOpenStatic
If FindLookIn = "QuotationNo" Then
'If FindLookIn = "Entire Database" Then
With adoQuoteRS
.MoveFirst
'.Find (FindLookIn & "= '" & findvalue & "'"
.Find ("QuotationNo = '%10881'"
'WHERE (QuotationNo LIKE '%10881')
If .BOF Then
MsgBox "Matching Record not Found"
End If
End With
End If
adoQuoteRS.Close
---------------------------------------------------------------
I cannot get VB to accept the LIKE as valid If I just look for the
entire value then I can find it with out using a wildcard character.
any help would be appreciated.
Also when I open my recordset in dynamic mode I get a recordcount of -1 ????