HI! I have succesfully used the code below to replaced quotation mark ( ' ) however, if i use the same code in my search textbox it gives me error. How do i let my search box accept quotation mark?
VB Code:
  1. Function doQuery(ByVal sCriteria As String, ByVal sfieldName As String) As String
  2.   doQuery = "SELECT Code, ProductDescription, SellingPrice,PurchasePrice,Quantity, " & _
  3.             "Unit,EntryDate, ReOrder FROM tblStocks " & _
  4.               "WHERE " & sfieldName & " LIKE '" & sCriteria & "%'"
  5. End Function
  6.  
  7. Private Sub txtSearch_Change()
  8.   Dim rsStocks1 As New ADODB.Recordset
  9.   sSQL = doQuery(txtSearch.Text, "ProductDescription")
  10.   rsStocks1.Open sSQL, oConn, adOpenForwardOnly, adLockOptimistic
  11.  
  12.   If rsStocks1.EOF = False Then
  13.     Call FillListView(lstStocks, rsStocks1)
  14.   End If
  15. End Sub